Top "Django-aggregation" questions

django-aggregation refers to an ability to aggregate a collection of objects provided by Django database-abstraction API

How to group by AND aggregate with Django

I have a fairly simple query I'd like to make via the ORM, but can't figure that out.. I have …

django django-aggregation
Django: Group by date (day, month, year)

I've got a simple Model like this: class Order(models.Model): created = model.DateTimeField(auto_now_add=True) total = models.…

django django-aggregation
How to filter objects for count annotation in Django?

Consider simple Django models Event and Participant: class Event(models.Model): title = models.CharField(max_length=100) class Participant(models.Model): …

python django django-models django-aggregation
Django 1.11 Annotating a Subquery Aggregate

This is a bleeding-edge feature that I'm currently skewered upon and quickly bleeding out. I want to annotate a subquery-aggregate …

django django-aggregation django-annotate django-subquery
Django order_by() filter with distinct()

How can I make an order_by like this .... p = Product.objects.filter(vendornumber='403516006')\ .order_by('-created').distinct(…

django django-models django-aggregation django-filters
Django equivalent of COUNT with GROUP BY

I know Django 1.1 has some new aggregation methods. However I couldn't figure out equivalent of the following query: SELECT player_…

python sql django django-queryset django-aggregation
Get minimum value field name using aggregation in django

I have a model with some fields like below class Choclate(models.Model): name = models.CharField(max_length=256) price = models.…

python django min django-aggregation
Annotating SUM aggregation function leading to 'None' value in Django

Doing my first real Django project, and need guidance. Background: My project is a reddit clone. Users submit links+text. …

python django django-models django-queryset django-aggregation
Display Django values() on Foreign Key in template as object instead of its id

I have a queryset in Django that calls Model.objects.values('item')... where 'item' is a Foreign Key. class Words(…

django django-templates django-aggregation
Django GROUP BY strftime date format

I would like to do a SUM on rows in a database and group by date. I am trying to …

python django orm django-models django-aggregation