1👍
✅
First: if something=elem
condition does not match any object, you won’t get None
, someModel
will raise a DoesNotExist
exception.
Second, you could try this:
return_list = someModel.objects.filter(something__in=elemList)
return return_list
Source:stackexchange.com