#27629: Inconsistent check of allow_relation in 
ForwardManyToOneDescriptor.__set__
-------------------------------------+-------------------------------------
     Reporter:  Sven Coenye          |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.10
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  allow_relation       |             Triage Stage:  Accepted
  ForwardManyToOneDescriptor         |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Sven Coenye):

 Perhaps a slightly overzealous optimization?

 To test further, I changed the two ForeignKey fields to point to models in
 a second application residing in the same database, and simplified
 allow_relation in the database router to:
 {{{
     def allow_relation(self, obj1, obj2, **hints):
         return False
 }}}
 The outcome remained the same. No errors are raised if only a single field
 links to an external model. If more fields are present, the first field
 gets a pass, the second field trips the ValueError exception.

--
Ticket URL: <https://code.djangoproject.com/ticket/27629#comment:2>
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/065.90e227ec840ecbc9eab9514338a18186%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to