#18375: F() doesn't work as expected across multijoin relations
-------------------------------------+-------------------------------------
     Reporter:  FunkyBob             |                    Owner:  akaariai
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.4
  (models, ORM)                      |               Resolution:
     Severity:  Release blocker      |             Triage Stage:  Accepted
     Keywords:                       |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by akaariai):

 Hmmh, I think this one is even more complex than I previously thought -
 how about
 {{{
 qs.filter(someval=F('revrel__somecol'), revrel__othercol=F('someval'))
 }}}
 If the first kwarg is seen first, then we will create a join for revrel.
 However, this join is _not_ reusable for the second filter's lookup. If
 these are seen in the other order, then we first generate revrel for the
 lookup, then reuse it in F().

 I know we can fix the above. But I am wondering if we could just weasel
 out of this situation: document that use Q() lookups instead if dict
 ordering might be a problem. Q() lookups do have a defined order, so there
 is no problem in that case.

 I have a work in progress patch at:
 https://github.com/akaariai/django/compare/ticket_18375

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18375#comment:10>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to