0👍
✅
I’ve found the solution: module django-group-by allows to apply grouping to querysets, like this:
Model3.objects.group_by('model2__model1')
(You need to mix GroupByMixin
into the model manager)
- In the edit form of Django CRUD application the existing data is not showing correctly in the fields
1👍
I know you can do the following
Model3.objects.order_by('model2__model1_id', 'model2__date').distinct('model2__model1_id')
Unfortunately it’s not sorted by model2.date
, but for each model1.id
the model2.date
is the least, and it’s sorted by model1 id
- Compare data from two different models with Django
- Django and mysql on different servers performance
- How to store array of Python dicts in PostgreSQL?
- SNS notifications to Browser
- Django admin change_form with ajax query
Source:stackexchange.com