#15130: Model.validate_unique method doesn't take in account multi-db
-------------------------------------+-------------------------------------
     Reporter:  t2y                  |                    Owner:
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  multi-db             |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by akaariai):

 Hmmh, I think the core problem is that .validate() doesn't take a using
 argument, while some of the checks are dependent on the used database. I
 don't think we can fix this without adding the using argument.

 If we do that, then ModelForms should likely also have
 .is_valid(using=...) keyword argument. The next question is should the
 using argument be used for ModelChoiceField queryset checks, too? I say
 yes, with the exception that if the queryset has an explicit using
 argument, then honor that.

 We can start with adding using argument to .validate() only, and then
 continue to further changes if wanted.

 Any opinions if we should go forward with this?

--
Ticket URL: <https://code.djangoproject.com/ticket/15130#comment:15>
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/061.d82b39231c0463c2a3d6c99801542746%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to