#3592: Allowing Q Objects to select between OUTER and INNER joins (semi-
intelligently)
--------------------------------+-------------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: mtredinnick
Status: new | Component: Database wrapper
Version: SVN | Resolution:
Keywords: Q,QuerySet,JOINs | Stage: Accepted
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
--------------------------------+-------------------------------------------
Comment (by [EMAIL PROTECTED]):
While I'm well aware that there is a !QuerySet refactoring going on, I'm
afraid that it's going to come along much too late. The fact of the matter
is, the current implementation of Q OR'ing could best be described as a
bug. From what I read it sounds like 0.96 is going to be the last release
before a slew of backwards-incompatible changes get merged (oldforms
becomes defunct, this queryset refactoring...).
This means, that if someone starts using Django, and needs to use Q
objects to OR (pretty reasonable, my site is using it for our permission
systems), they might come across this bug (which I think would appear
pretty obscure to them if they haven't read through this code), with no
where to go except maybe writing raw SQL for each of these. Might it be
worth raising a NotImplementedError for ORs that have foreign-key lookups?
IMHO that's better than the current result.
This is why I posted it here. I'd at least like if someone runs into this
problem to know there's at least a patch they can apply that's not fully
tested.
Replying to [comment:5 mtredinnick]:
> Constructing more intelligent join types is one of the goals of the
!QuerySet refactoring -- in fact it was one of the things that started us
thinking about it. Since {{{Q()}}} objects are really just a way of
passing information to the !QuerySet construction -- and they aren't going
away -- this will be fixed as part of that. I'm reluctant to be tweaking
{{{Q()}}} objects much, since the refactoring is being worked on at the
moment (although it will be post-0.96).
>
> Removing the patch keywords, because I don't want to apply this patch
(although thanks for writing it up anyway -- it looks reasonable). Let's
leave {{{Q()}}} objects stable in the brief runup to 0.96 and make the big
changes immediately afterwards.
--
Ticket URL: <http://code.djangoproject.com/ticket/3592#comment:6>
Django Code <http://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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---