I have the following query:
titles = Title.objects.all()
I need to get DISTINCT ('title') for this query under certain circumstances. Django does not allow distinct('title') while using a MySQL backend.
Essentially, what I want to do is something like:
titles = titles.extra('GROUP BY title')
How would I do this correctly?
You need to do
[annotate][1]to group by