공부
[Django] filter query
승가비
2020. 7. 28. 22:20
728x90
from myapp.models import Entry
from django.db.models import Q
Entry.objects.filter(~Q(id = 3))
https://stackoverflow.com/questions/687295/how-do-i-do-a-not-equal-in-django-queryset-filtering
How do I do a not equal in Django queryset filtering?
In Django model QuerySets, I see that there is a __gt and __lt for comparitive values, but is there a __ne/!=/<> (not equals?) I want to filter out using a not equals: Example: Model: ...
stackoverflow.com
728x90