From the Django documentation:
Blog.objects.filter(pk__in=[1, 4, 7])
More Related Contents:
- How do I filter query objects by date range in Django?
- Django filter queryset __in for *every* item in list
- Django Aggregation: Summation of Multiplication of two fields
- How can I filter a date of a DateTimeField in Django?
- Getting the SQL from a Django QuerySet [duplicate]
- How do I do a not equal in Django queryset filtering?
- Django Query That Get Most Recent Objects From Different Categories
- How do I get the object if it exists, or None if it does not exist in Django?
- Django orm get latest for each group
- django – convert a list back to a queryset [duplicate]
- Django values_list vs values
- many-to-many in list display django
- How to combine multiple querysets in Django?
- “_set” in a queryset object in Django
- Count number of records by date in Django
- aggregate() vs annotate() in Django
- Count() vs len() on a Django QuerySet
- How to perform OR condition in django queryset?
- Simple Subquery with OuterRef
- QuerySet, Object has no attribute id – Django
- Django custom annotation function
- Using .aggregate() on a value introduced using .extra(select={…}) in a Django Query?
- How to do many-to-many Django query to find book with 2 given authors?
- Get the latest record with filter in Django
- django filter on the basis of text length
- Django filter JSONField list of dicts
- How to annotate Count with a condition in a Django queryset
- How to delete a record in Django models?
- Can a dictionary be passed to django models on create?
- How to copy InMemoryUploadedFile object to disk