There is Q
objects that allow to complex lookups. Example:
from django.db.models import Q
Item.objects.filter(Q(creator=owner) | Q(moderated=False))
More Related Contents:
- How can I combine two or more querysets in a Django view?
- How to filter empty or NULL names in a QuerySet?
- Custom QuerySet and Manager without breaking DRY?
- Why does django’s prefetch_related() only work with all() and not filter()?
- Select DISTINCT individual columns in django?
- _set in Django for a queryset
- Raw SQL queries in Django views
- How to limit queryset/the records to view in Django admin site?
- Django: implementing JOIN using Django ORM?
- Django – filtering on foreign key properties
- How to create a Django queryset filter comparing two date fields in the same model
- Django Queryset with filtering on reverse foreign key
- How to dynamically provide lookup field name in Django query? [duplicate]
- Django lazy QuerySet and pagination
- Django: ManyToMany filter matching on ALL items in a list
- Django query datetime for objects older than 5 hours
- Django, query filtering from model method
- Django: Does prefetch_related() follow reverse relationship lookup?
- django most efficient way to count same field values in a query
- Django Order By Date, but have “None” at end?
- Django query case-insensitive list match
- Django: __in query lookup doesn’t maintain the order in queryset
- Django queryset get exact manytomany lookup [duplicate]
- how to write a query to get find value in a json field in django
- Django: How can I protect against concurrent modification of database entries
- How do you run a worker with AWS Elastic Beanstalk?
- Django : How can I see a list of urlpatterns?
- How to get Django and ReactJS to work together?
- django : Serving static files through nginx
- Can a dictionary be passed to django models on create?