python - DISTINCT ON in django -


this question has answer here:

how following query:

ordernotes.objects.filter(item=item).distinct('shared_note') 

basically, need ordernotes items, distinct on shared_note. when try , get:

    raise notimplementederror('distinct on fields not supported database backend')  notimplementederror: distinct on fields not supported database backend 

i using mysql , cannot change db here. workaround in django?

ordernotes.objects.filter(item=item).values_list('shared_note', flat=true).distinct() 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -