How do I do a not equal in Django queryset filtering?
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
You must login to ask question.
You can use Q objects for this. They can be negated with the
~
operator and combined much like normal Python expressions:will return all entries except the one(s) with
3
as their ID: