I'm worried this doesn't work in the general case, as there are a lot of
different query formats one can write with raw SQL, such as UNION, SQL
variables, or other database specific formats. You have a lot of code
there, but from what I can tell the code is simply setting up the
RawSqlCompiler which adds WHERE etc. after the raw SQL, ignoring the fact
that there could already be a WHERE in it - am I right?

Also - what do you find raw queries being needed for? In general the ORM is
very capable these days and the general development focus on it is to make
it cover even more of SQL's capabilities.

On 20 April 2017 at 20:36, Dmitriy Sintsov <[email protected]> wrote:

> Hi!
> I implemented FilteredRawQuerySet which supports filter() and order_by()
> like model manager QuerySet.
>
> https://code.djangoproject.com/ticket/28087
> https://github.com/Dmitri-Sintsov/django-jinja-knockout/
> blob/master/django_jinja_knockout/query.py
>
> Internally it contains RawQuerySet and QuerySet for the target model.
>
> SELECT part of the query is borrowed from RawQuerySet, while WHERE and
> ORDER BY statements are generated via QuerySet query.
>
> This feature is useful when the code uses programmatically generated
> arguments of filter() / order_by(), for example in class-based ListView
> with custom filtering and / or sorting.
>
> Is such feature worth to be included to Django core?
>
> I could just continue to use my own implementation (probably imperfect)
> however I am worrying about possible query generation code changes that
> could make my module incompatible in the future.
>
> In case such queryset would be included to Django code, there are much
> more chances that the code which uses it would not break when updating to
> newer Django version.
>
> Dmitriy
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" 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].
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-developers/a20e043e-aec8-4806-9e6b-
> c5c669361c44%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/a20e043e-aec8-4806-9e6b-c5c669361c44%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" 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].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM1MVG3-sYCsOv0V59y%3Dqe0FbjHzv%2B%3DkcYU4W%3DvMnFx4GA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to