No, that wouldn't work because Category looks like a var on Novel, not
a model in it's own right.
Novels.objects.filter(category="comedy") is how to get a distinct category.
To get the list of categories used, use distinct for a quick hack -
something like:
Novel.objects.order_by('category').distinct('category')
Cheers
L.
>
https://groups.google.com/d/msgid/django-users/4800DB60-6DD7-43A1-9B1F-2E518C56242F%40gmail.com.
The idea of anathematising all of a person’s good works because of
something else they said or did is just as alien and repellent to us
as our reaction is to someone who wishes Hacker News would die because
Paul Graham is kind of a dick sometimes. ... Sergey Bratus points out
that keeping works by “ideologically impure” persons out of public
view was instrumental to Soviet systems of social control. And as
@puellavulnerata acutely observes, a culture that encourages judging
people unilaterally, rather than judging their actions in context, is
one that allows socially-adept hierarchy climbers to decontextualise
their own self-serving cruelties as “necessary for the cause” and
stage witchcraft trials against the weirdoes on the margin.
-----------------------------------------------------------------------------------------------------------
https://medium.com/p/31895b01e68c