#35676: ExclusionConstraint that includes a ForeignKey fails validation in
ModelForm
------------------------------+------------------------------------
     Reporter:  Take Weiland  |                    Owner:  (none)
         Type:  Bug           |                   Status:  new
    Component:  Forms         |                  Version:  5.1
     Severity:  Normal        |               Resolution:
     Keywords:                |             Triage Stage:  Accepted
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+------------------------------------
Comment (by Take Weiland):

 I've manually applied your patch to a custom ModelForm subclass and it
 does solve the problematic SQL query.
 When altering existing objects, the query happens correctly (with the
 correct config ID substituted). When creating a new object, it will do a
 `WHERE config_id = NULL AND date_range && (...)`. That doesn't cause any
 problems though, because the = NULL comparison will just always yield NULL
 and thus no rows will be returned.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35676#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070191503a14f9-9bad02ed-dad3-49b4-ab1e-33e3623299bf-000000%40eu-central-1.amazonses.com.

Reply via email to