I use django-taggit to create an application that stores not only tasks, but also information elements. You can specify certain elements and information elements.
When I pull out a list of tags for tasks, I run the following query:
action_tags = Tag.objects.order_by('name').filter(action__complete=False).annotate(action_count=Count('action'))
This gives me the name of all tags for which there is incomplete data. It also gives me a partial dose count.
For information elements, there is no field for "complete"; information elements are simply "there." Therefore, I want to write a query that pulls out all the tags for which there is at least one information element. How can this be written?
source
share