[Answered ]-Django ORM fetching

1👍

You can use the __in lookup [Django-doc]:

obj = models.Products.objects.filter(description__in=[a list of descriptions])

That being said, often using such queries actually aims to solve another more fundamental problem. It might be better to look why you think you need to filter on a list of descriptions, since that is often not necessary.


Note: normally a Django model is given a singular name, so Product instead of Products.

Leave a comment