[Django]-What is the equivalent for, SELECT * FROM table_name WHERE id IN (1,2,5,9) in Django

4👍

note that ids i will assume is a list.

def post(self, request, *args, **kwargs):
    req = self.request.POST
    ids = req.get('ids')
    imported_data =table_import.objects.filter(id__in=ids)

Leave a comment