Select DISTINCT individual columns in django?
I'm curious if there's any way to do a query in Django that's not a " SELECT * FROM... " underneath. I'm trying to do a " SELECT DISTINCT columnName FROM ... " instead. Specifically I have a model that looks like: class ProductOrder(models.Model): Product = models.CharField(max_length=20, promary_key=True) Category = models.CharField(max_length=30) Rank = models.IntegerField() where the Rank is a rank within a Category . I'd like to be able to iterate over all the Categories doing some operation on each rank within that category. I'd like to first get a list of all the categories in the system