Re: #28560 - distinct() on ordered queryset with restricted list of columns returns incorrect result

2020-10-28 Thread charettes
I'm also a fan of option 3. to require an explicit opt-in or raise an error. Not a lot of folks are familiar with this requirement imposed by the usage of DISTINCT and even if Model.Meta.ordering is the most common reason but unexpected ordering it can also be caused by the dynamic creation of a

Re: #28560 - distinct() on ordered queryset with restricted list of columns returns incorrect result

2020-10-28 Thread Tobias McNulty
I tend to agree, though I'll note that was also a bug at one point: https://code.djangoproject.com/ticket/5321 On Wed, Oct 28, 2020 at 5:38 PM Fran Hrženjak wrote: > Personally I would prefer to get a ProgrammingError, so option 3. > > Explicit is better then implicit 😁 > > Here is a great expla

Re: #28560 - distinct() on ordered queryset with restricted list of columns returns incorrect result

2020-10-28 Thread Fran Hrženjak
Personally I would prefer to get a ProgrammingError, so option 3. Explicit is better then implicit 😁 Here is a great explanation of this exact issue, cleared it up for me: https://blog.jooq.org/2018/07/13/how-sql-distinct-and-order-by-are-related/ > On 28.10.2020., at 20:04, Tobias McNulty

Re: #28560 - distinct() on ordered queryset with restricted list of columns returns incorrect result

2020-10-28 Thread Tobias McNulty
On Wed, Oct 28, 2020 at 3:38 PM Adam Johnson wrote: > I’d vote for option 2. I don’t think it can be expected the ordering will > be obeyed when not selecting the columns it includes. > Thanks! To make sure I understand, are you suggesting we should leave the behavior with an explicit order_by()

Re: #28560 - distinct() on ordered queryset with restricted list of columns returns incorrect result

2020-10-28 Thread Adam Johnson
I’d vote for option 2. I don’t think it can be expected the ordering will be obeyed when not selecting the columns it includes. On Wed, 28 Oct 2020 at 19:03, Tobias McNulty wrote: > Hi all, > > Starting a thread on ticket #28560 > , "distinct() on ord

#28560 - distinct() on ordered queryset with restricted list of columns returns incorrect result

2020-10-28 Thread Tobias McNulty
Hi all, Starting a thread on ticket #28560 , "distinct() on ordered queryset with restricted list of columns returns incorrect result." In a nutshell: $ cat testapp/models.py from django.db import models class School(models.Model): name = mode

Re: Ticket update ending up in gmail spam

2020-10-28 Thread Tobias McNulty
Thanks for the report. The SPF record was updated today around 1:30pm EDT. Please let us know if you continue to see issues. On Thu, Oct 22, 2020 at 12:10 PM Adam Johnson wrote: > Perhaps there's a task for the ops team to check the SPF/DKIM/DMARC > records for djangoproject.com ? > > ‪On Thu,

Re: Pass existing model Instance to update_or_create callables

2020-10-28 Thread Adam Johnson
Yes, it does, my bad. On Wed, 28 Oct 2020 at 17:03, James Pulec wrote: > Hey Adam, > > Thanks for the clarification. I totally get that this might be a bit too > complex, and maybe shouldn't wind up in update_or_create(), so I can > definitely just use my own manager method. I'm a little confuse

Re: Pass existing model Instance to update_or_create callables

2020-10-28 Thread James Pulec
Hey Adam, Thanks for the clarification. I totally get that this might be a bit too complex, and maybe shouldn't wind up in update_or_create(), so I can definitely just use my own manager method. I'm a little confused by this statement, though: "It doesn't actually fetch the updated model insta