#20581: Support DEFERRABLE INITIALLY DEFERRED for UNIQUE constraints
-------------------------------------+-------------------------------------
     Reporter:  dmadeley@…           |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  db-indexes           |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Jon Dufresne):

 > I suppose this will be possible with the ​advanced index API.

 I was able to create a POC using class based indexes, however it doesn't
 integrate as well as `unique_together`. `Model._get_unique_checks()` which
 is called by `Model.validate_unique()` which is used to clean model forms,
 will make no attempt to validate unique constraints defined through a
 class based index. What do you think about adding a hook
 `Index.get_unique_checks()` -- to be called by
 `Model._get_unique_checks()` -- so constraints defined this way can be
 used to enforce unique constraints in model forms?

--
Ticket URL: <https://code.djangoproject.com/ticket/20581#comment:11>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/085.1e180d720d7ed06fb70bb14ca2a979ac%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to