I would prefer the QuerySet method than documenting parts of Query -
QuerySet shouldn't have to make guarantees that its interactions with Query
won't change, plus making Query in some way a public API could hamper
features. Plus the amount of code is small and contained.
Also I think worrying about 'nonsense' cases is a bit of a distraction, we
already support some 'nonsense' cases like .order_by('?', '?') because the
API is trying to be as generic as possible. And order_by(None,
append=True) could
be made into a simple ValueError as it does indeed not make sense to ask
for that.
On 11 December 2017 at 23:52, Markus Holtermann <[email protected]>
wrote:
> Thanks for the input, Shai. I'd like to keep the current behavior
> around. So .order_by(None) would still reset the ordering as-is.
>
> But I agree, if we'de exposing QuerySet.query.order_by through a
> documented API that would work for me as well (in fact, I'm using that
> right now to work around the issue).
>
> Cheers,
>
> Markus
>
> On 12/11/2017 10:27 PM, Shai Berger wrote:
> > Hi Markus and all,
> >
> > My instinct is that it's better to just make sure it's easy to find the
> current
> > ordering on a queryset. I suspect the use-case for modifications is not
> super
> > common, and I'd rather not bother with specifying the exact behavior of
> > nonsense cases like order_by(None, append=True) and
> > order_by('?', prepend=True) -- which, as the framework, we'd be required
> to
> > do, but if you're modifying a list on your own, you're free to ignore.
> >
> > My 2 cents,
> > Shai.
> >
>
> --
> 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/ms
> gid/django-developers/d1258e72-93a0-4075-da65-9f09902845f1%4
> 0markusholtermann.eu.
> 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/CAMyDDM3GHaVeKoxM6AgtH_o22Oz8s%3Dq53QVyRnZSitm96MoeMg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.