Recipe.objects.all().annotate(ingredients_list=ArrayAgg('ingredients__name', ordering='ingredients__id'))
The fix hasn’t been released yet. It’s in the master branch, and it was committed on June 28. If I understand it correctly, it should pop up in the next release. https://github.com/django/django/pull/7604
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
django-users...@googlegroups.com.
To post to this group, send email to
django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/6d38377c-c017-4626-96d1-9a6c1c9573ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
The fix hasn’t been released yet. It’s in the master branch, and it was committed on June 28. If I understand it correctly, it should pop up in the next release. https://github.com/django/django/pull/7604
From: django...@googlegroups.com [mailto:django...@googlegroups.com] On Behalf Of Maya Balakrishnan
Sent: Friday, August 24, 2018 2:29 PM
To: Django users
Subject: ArrayAgg ordering not working?
Hi! I'm trying to use an ArrayAgg and order the results in each array. I found this closed ticket which looks like this feature has been created an merged in but when I try doing a query like
Recipe.objects.all().annotate(ingredients_list=ArrayAgg('ingredients__name', ordering='ingredients__id'))
and print out the query it's running it doesn't seem to be attempting to order the ingredients_list. Is there something I'm doing wrong?
Thanks!!
-Maya
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to djang...@googlegroups.com.