Answers for "django filter not equal to"

1

django filter not equal to

from myapp.models import Entry
from django.db.models import Q
# Returns all entries except those with 3 as their id
Entry.objects.filter(~Q(id=3))
Posted by: Guest on January-11-2022

Python Answers by Framework

Browse Popular Code Answers by Language