#28087: RawQuerySet with filtering and ordering.
-------------------------------------+-------------------------------------
Reporter: Dmitriy | Owner: nobody
Sintsov |
Type: New | Status: new
feature |
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I implemented FilteredRawQuerySet which wraps around RawQuerySet and uses
QuerySet to generate WHERE / ORDER BY statements for raw queries:
https://github.com/Dmitri-Sintsov/django-jinja-
knockout/blob/master/django_jinja_knockout/query.py
It works with Django 1.8 to 1.11, but I had to fix it when database
queries code were refactored in Django 1.9. So I am worrying a bit that
new modifications can break it again.
Such querysets are useful when someone uses RAW queryset with ListViews
which automatically generate filter() / order_by() arguments.
There is also a ListQuerySet which allows to query Prefetch object results
as normal querysets. That allows to re-use the same code for different
related queries.
If that is possible, it would be great to move such feature into the core.
If the code is not good enough, then it could be reviewed and improved by
core committer - if someone is interested, of course.
--
Ticket URL: <https://code.djangoproject.com/ticket/28087>
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/057.05a2038a667e1b9e0a9338b30d2a9998%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.