Let the models class:
class MyModel(models.Model):
name = models.CharField(max_length=200)
category = models.CharField(max_length=200)
I want to get all the objects of MyModel
except those with a specific category. I'm using this code:
[mm for mm in MyModel.objects.all() if mm.category != u'mycategory']
Is there another solution for this question?