Re: Custom Join Conditions

2017-09-05 Thread Michael Manfre
On Tue, Sep 5, 2017 at 5:10 AM Adam Johnson wrote: > from django.db.models import FilteredRelation is what I'd expect > This is what I'd expect too. > On 5 September 2017 at 09:44, Nicolas Delaby wrote: > >> It seems we have a consensus. >> I'll be glad to push that change. >> >> I just have

Re: Custom Join Conditions

2017-09-05 Thread Adam Johnson
from django.db.models import FilteredRelation is what I'd expect On 5 September 2017 at 09:44, Nicolas Delaby wrote: > It seems we have a consensus. > I'll be glad to push that change. > > I just have a question, from where do you want users importing the class > FilteredRelation ? > From its cu

Re: Custom Join Conditions

2017-09-05 Thread Nicolas Delaby
It seems we have a consensus. I'll be glad to push that change. I just have a question, from where do you want users importing the class FilteredRelation ? >From its current location ? from django.db.models.query import FilteredRelation or from its parent module ? from django.db.models imp

Re: Custom Join Conditions

2017-09-04 Thread Adam Johnson
The annotate(foo=FilteredRelation(...)) API LGTM too, and yes I agree on the rationale on alias over to_attr. On 4 September 2017 at 10:25, Anssi Kääriäinen wrote: > I really like the .annotate() version. The way this feature works with > .annotate() is easy to understand if you understand how e

Re: Custom Join Conditions

2017-09-04 Thread Anssi Kääriäinen
I really like the .annotate() version. The way this feature works with .annotate() is easy to understand if you understand how existing .annotate() functions work. But, if we go with this approach, it might look a bit strange if we don't do an automatic select_related(). On the other hand, there

Re: Custom Join Conditions

2017-09-02 Thread Shai Berger
st 2017 at 00:32, Josh Smeaton wrote: > > There's currently a patch https://github.com/django/django/pull/7560 for > > ticket https://code.djangoproject.com/ticket/27332 that implements custom > > join conditions. It was nearly ready for merge for 1.11 but slipped.

Re: Custom Join Conditions

2017-09-02 Thread Adam Johnson
r, as it aligns with prefetch_related. On 29 August 2017 at 00:32, Josh Smeaton wrote: > There's currently a patch https://github.com/django/django/pull/7560 for > ticket https://code.djangoproject.com/ticket/27332 that implements custom > join conditions. It was nearly ready f

Custom Join Conditions

2017-08-28 Thread Josh Smeaton
There's currently a patch https://github.com/django/django/pull/7560 for ticket https://code.djangoproject.com/ticket/27332 that implements custom join conditions. It was nearly ready for merge for 1.11 but slipped. There are some merge conflicts the author still needs to sort out, but no