from django.db.models import FilteredRelation is what I'd expect On 5 September 2017 at 09:44, Nicolas Delaby <[email protected]> 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 current location ? > > from django.db.models.query import FilteredRelation > > or from its parent module ? > > from django.db.models import FilteredRelation > > as it seems to be the django way. > > Best, > Nicolas > > On 04/09/2017 13:30, Adam Johnson wrote: > > 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 <[email protected] > <mailto:[email protected]>> wrote: > > > > 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 are cases where you definitely don't want to do a > select_related(), like if the relation annotation is only used in further > > aggregation. So, maybe there should be opt-out, or maybe we just > don't do any automatic select_related for this case. > > > > I do like the .annotate() version for other reasons, too. There are > variants of this feature which would work nicely with the annotate style, > that > > is either annotation querysets for objects that do *not* have a > relation to the original queryset, or annotation raw SQL directly. > > > > - Anssi > > PS. It seems the Google Groups UI acts a bit strange for me today. I > hope this post does arrive to the group in a readable format... > > > > -- > > 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] > > <mailto:django-developers%[email protected]>. > > To post to this group, send email to django-developers@ > googlegroups.com <mailto:[email protected]>. > > Visit this group at https://groups.google.com/ > group/django-developers <https://groups.google.com/group/django-developers > >. > > To view this discussion on the web visit > > https://groups.google.com/d/msgid/django-developers/ > 4ceb0715-bd6b-4860-a6e6-77dc9ecabae6%40googlegroups.com > > <https://groups.google.com/d/msgid/django-developers/ > 4ceb0715-bd6b-4860-a6e6-77dc9ecabae6%40googlegroups.com>. > > For more options, visit https://groups.google.com/d/optout < > 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] > > <mailto:[email protected]>. > > To post to this group, send email to [email protected] > <mailto:[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/ > CAMyDDM0n5K9nLz1V1kWgEiHnRiOX4V6ai_TpFp0ahoXV5GDbVQ%40mail.gmail.com > > <https://groups.google.com/d/msgid/django-developers/ > CAMyDDM0n5K9nLz1V1kWgEiHnRiOX4V6ai_TpFp0ahoXV5GDbVQ%40mail. > gmail.com?utm_medium=email&utm_source=footer>. > > For more options, visit https://groups.google.com/d/optout. > > -- > 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/a85c8823-4d17-97f6-5543-3a15f8147880%40free.fr. > 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/CAMyDDM3i_H3zZsv2Y44Ji%2BDTPM67qU3JaVvL9Y%2BsVx1xsh7AcA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
