You can use Q objects to do what you want, by bitwise OR-ing them together:
from django.db.models import Q
Publisher.objects.filter(Q(name__contains="press") | Q(country__contains="U.S.A"))
Related Contents:
- sql “LIKE” equivalent in django query
- Raw SQL queries in Django views
- What is the SQL ”LIKE” equivalent on Django ORM queries?
- LEFT JOIN Django ORM
- What’s the difference between select_related and prefetch_related in Django ORM?
- How to see the raw SQL queries Django is running?
- Can “list_display” in a Django ModelAdmin display attributes of ForeignKey fields?
- Django auto_now and auto_now_add
- Django values_list vs values
- Automatic creation date for Django model form objects
- How to pull a random record using Django’s ORM?
- In Django, how does one filter a QuerySet with dynamic field lookups?
- How to filter objects for count annotation in Django?
- Django rest framework serializing many to many field
- Getting TypeError: __init__() missing 1 required positional argument: ‘on_delete’ when trying to add parent table after child table with entries
- Split models.py into several files
- Django signals vs. overriding save method
- Django filter many-to-many with contains
- django abstract models versus regular inheritance
- how to import csv data into django models
- Get all related Django model objects
- Check if OneToOneField is None in Django
- Django Model MultipleChoice
- django syncdb and an updated model
- How can I programmatically obtain the max_length of a Django model field?
- Django – FileField check if None
- django template system, calling a function inside a model
- Identify the changed fields in django post_save signal
- In the Django admin interface, is there a way to duplicate an item?
- How do I restrict foreign keys choices to related objects only in django
- one-to-many inline select with django admin
- How to use UUID
- update django database to reflect changes in existing models
- How to have a Python script for a Django app that accesses models without using the manage.py shell?
- Django Admin nested inline
- Django model fields validation
- Django model method – create_or_update
- How to create Password Field in Model Django
- Generate unique id in django from a model field
- How to set another Inline title in Django Admin?
- Adding Custom Django Model Validation
- Setting default value for Foreign Key attribute in Django
- Difference between ‘related_name’ and ‘related_query_name’ attributes in Django?
- Get a list of all installed applications in Django and their attributes
- Writing test cases for django models
- How to change Django Admin Custom list field label?
- Download a remote image and save it to a Django model
- Is there a datetime ± infinity?
- Django : Table doesn’t exist
- django post_save signals on update