mercredi 6 juillet 2016

Convert Mysql group by to ORM


I have a MySQL query that I need help converting to use django's ORM

select * from TABLE where ID=10 group by LOCATION order by DATE DESC

Thus far I have TABLE.objects.filter(id='10').order_by('-date') but I am unsure how to do the group by in Django.


Aucun commentaire:

Enregistrer un commentaire