Reputation: 45
How can you do a filter and do something like this in django
model.objects.filter(user_id = request.user.id , thing != 0)
I mean i wnat do something that it get only objects that their thing in not 0 .
Upvotes: 0
Views: 77
Reputation: 1445
The exclude() method will do the job.
model.objects.filter(user_id = request.user.id).exclude(thing = 0)
Upvotes: 2