Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
most_used_topic = (
Target.objects
.values("topic")
.annotate(topic_count=Count("topic"))
.order_by("-topic_count")
.first()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment