#17600: Error in encapsulates filters (Q)
-------------------------------------+-------------------------------------
Reporter: pmartin | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.3
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 1
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by akaariai):
* needs_better_patch: 0 => 1
* stage: Ready for checkin => Accepted
Comment:
The patch isn't good enough yet. Mainly, the in_negated flag for
build_filter() doesn't work properly. It is used for two things, first for
answering if the filter needs subquery, and in this case the answer is yes
if the three contains negated=True at any point, and also for IS NULL
checking, and in this case the answer comes from the current state of the
negation, that is the IS NULL check is needed only if the path contains
odd amount of NOTs, otherwise they will cancel each other.
In addition I have been playing back-and-forth with add_filter() and
build_filter(). The build_filter() naming isn't good, it alters the
query's joins but the name suggests it just builds the filter condition.
So, for that reason too this patch needs still improvement.
--
Ticket URL: <https://code.djangoproject.com/ticket/17600#comment:27>
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].
For more options, visit https://groups.google.com/groups/opt_out.