#20939: Convert QuerySet to Query when filtering
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Database | Keywords:
layer (models, ORM) | Has patch: 0
Severity: Normal | Needs tests: 0
Triage Stage: Accepted | Easy pickings: 0
Needs documentation: 0 |
Patch needs improvement: 0 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
The current ORM coding has very similar, yet not equivalent paths for
using QuerySet and the internal Query when doing
filter(something=queryset_or_query). It seems that converting a QuerySet
to Query early on would lead to cleaner implementation. Proof of concept
here: https://github.com/akaariai/django/tree/queryset_to_query_in_filter
There are two problems in the current implementation:
- The way user-defined .values() and Django issued .values() in
build_filter() is detected is ugly
- There is no multidb protection (test_subquery in
multiple_database.tests.QueryTestCase) fails).
I'll mark this as accepted directly in the sense of "worth doing if above
problems can be addressed).
--
Ticket URL: <https://code.djangoproject.com/ticket/20939>
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/051.a3d2d309725c1b49277a700d16aa0417%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.