Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django queryset unique values

# Count Avg Sum etc. take a distinct argument for finding unique values
p = Project.objects.all().annotate(Avg('unit__name', distinct=True))
 
PREVIOUS NEXT
Tagged: #django #queryset #unique #values
ADD COMMENT
Topic
Name
3+7 =