#18816: Remove "trim" argument from add_filter()
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Database layer | Resolution:
(models, ORM) | Triage Stage:
Severity: Normal | Unreviewed
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by akaariai):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
I have updated the patch, and both of the above issues are resolved.
Resolving the first issue got somewhat dirty (because the related field
API is somewhat dirty), the second issue isn't as the allow_many change
for add_filter(trim=True) is there to prevent indefinite recursion. This
doesn't happen when the prefix is pre-trimmed.
I do think this is still a net gain in code clarity. Currently,
split_exclude() passes a flag to add_filter which passes it to trim_joins.
However, neither add_filter or trim_joins should know anything about this
special prefix trimming need of split_exclude(). In addition, it is hard
to see what exactly split_exclude() is doing, as it just passes a flag
around instead of just trimming the prefix.
Patch is at the same branch as before, tests in one commit, fix in
another.
--
Ticket URL: <https://code.djangoproject.com/ticket/18816#comment:1>
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.