Re: Provide option to chain QuerySet.order_by()

2017-12-23 Thread Adam Johnson
Now you've said it, having both seems reasonable to me too :) On 23 December 2017 at 17:42, Shai Berger wrote: > On Tue, 19 Dec 2017 17:58:35 + > Adam Johnson wrote: > > > Fair. I agree it's more flexible, but it does make "the most common > > case" of extending the ordering pretty long-win

Re: Provide option to chain QuerySet.order_by()

2017-12-23 Thread Shai Berger
On Tue, 19 Dec 2017 17:58:35 + Adam Johnson wrote: > Fair. I agree it's more flexible, but it does make "the most common > case" of extending the ordering pretty long-winded: > > ordering = qs.get_ordering() > ordering.append('new_field') > qs = qs.order_by(*ordering) > I don't object to h

Re: Provide option to chain QuerySet.order_by()

2017-12-19 Thread Mithlesh Kumar
Thanks, Adam! On Tuesday, December 12, 2017 at 2:40:11 AM UTC+5:30, Markus Holtermann wrote: > > Hi all, > > I'm in the situation where I'd like to join two .order_by() calls on a > QuerySet without losing the ordering set by the first call. > > This was formerly discussed in https://code.django

Re: Provide option to chain QuerySet.order_by()

2017-12-19 Thread Adam Johnson
Mithlesh, that's off-topic for this thread. But Django doesn't have it's issues on GitHub, it has them on Trac at https://code.djangoproject.com/ . See https://docs.djangoproject.com/en/dev/internals/contributing/ for a comprehensive guide on contributing. On 19 December 2017 at 17:58, Adam Johnso

Re: Provide option to chain QuerySet.order_by()

2017-12-19 Thread Adam Johnson
Fair. I agree it's more flexible, but it does make "the most common case" of extending the ordering pretty long-winded: ordering = qs.get_ordering() ordering.append('new_field') qs = qs.order_by(*ordering) On 18 December 2017 at 21:33, Shai Berger wrote: > On Fri, 15 Dec 2017 21:01:39 + > A

Re: Provide option to chain QuerySet.order_by()

2017-12-19 Thread Mithlesh Kumar
> > Can you please tell me where the issues of django are in GitHub ? > Thanks Mithlesh K -- 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

Re: Provide option to chain QuerySet.order_by()

2017-12-18 Thread Shai Berger
On Fri, 15 Dec 2017 21:01:39 + Adam Johnson wrote: > 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

Re: Provide option to chain QuerySet.order_by()

2017-12-15 Thread Adam Johnson
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 abo

Re: Provide option to chain QuerySet.order_by()

2017-12-11 Thread Markus Holtermann
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 is

Re: Provide option to chain QuerySet.order_by()

2017-12-11 Thread Adam Johnson
Seems like a good idea to me, I've been in a similar situation before and had to work around this part of QuerySets. On 11 December 2017 at 21:10, Markus Holtermann wrote: > Hi all, > > I'm in the situation where I'd like to join two .order_by() calls on a > QuerySet without losing the ordering

Re: Provide option to chain QuerySet.order_by()

2017-12-11 Thread Shai Berger
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

Provide option to chain QuerySet.order_by()

2017-12-11 Thread Markus Holtermann
Hi all, I'm in the situation where I'd like to join two .order_by() calls on a QuerySet without losing the ordering set by the first call. This was formerly discussed in https://code.djangoproject.com/ticket/9415 . I agree that simply changing the current behavior is not going to fly due to it