def get_model_or_none(model, *args, **kwargs):
 try:
  return model.objects.get(*args, **kwargs)
 except model.DoesNotExist:
  return None

def get_model_or_none ( model , * args , ** kwargs ) : try : return model . objects . get ( * args , ** kwargs ) except model . DoesNotExist : return None
get model object or return none .