[Solved]-Getting all objects of model except

15👍

Take a look at this documentation: https://docs.djangoproject.com/en/dev/topics/db/queries/#retrieving-specific-objects-with-filters , you want to use an exclude filter.

So somethig like:

objects = MyModel.objects.exclude(category= u'mycategory')

Leave a comment