def get_object_list(model, id_list):
 object_list = []
 for object_id in id_list:
  if object_id:
   object_list.extend(model.objects.filter(id=int(object_id)))
 return object_list

def get_object_list ( model , id_list ) : object_list = [ ] for object_id in id_list : if object_id : object_list . extend ( model . objects . filter ( id = int ( object_id ) ) ) return object_list
returns a list of objects of a model class .