Following is worth a watch https://opbeat.com/events/duth/#expressions
On Thursday, 10 December 2015 21:22:39 UTC, thinkwell wrote: > > So how would an query like this be written, with the new Query Expression > API? Where a count of events by day is required but the date column is > datetime? > > Triggers.objects.all().extra({"day": "date_trunc('day', date)"}). > values_list('name', 'severity', 'day').annotate(total=Count('severity')) > > > > > > On Wednesday, December 9, 2015 at 8:07:28 PM UTC-5, Russell Keith-Magee > wrote: >> >> Hi Luis, >> >> On Thu, Dec 10, 2015 at 7:10 AM, Luis Masuelli <luisfm...@gmail.com> >> wrote: >> >>> When I see the docs ( >>> https://docs.djangoproject.com/en/1.8/ref/models/querysets/#extra), I >>> notice .extra will be deprecated and removed. Is there a plan for the >>> replacement? As I see it, limiting ourselves to using Manager.raw() is not >>> a good idea, since you cannot work anymore on a RawQueryset object (as you >>> can work on any Queryset object you called .extra). So my question is: Is >>> there a good replacement for .extra being planned? >>> >> >> Yes - the Query Expression API. >> >> https://docs.djangoproject.com/en/1.9/ref/models/expressions/ >> >> Yours, >> Russ Magee %-) >> >> -- 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+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ec4072cf-65d5-4a9d-9afb-8362b3857de6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.