def get_model_instance(app_label, model_name, pk):
 model = apps.get_model(app_label, model_name)
 if (not model):
  return None
 try:
  instance = model._default_manager.get(pk=pk)
  return instance
 except model.ObjectDoesNotExist:
  pass
 return None

def get_model_instance ( app_label , model_name , pk ) : model = apps . get_model ( app_label , model_name ) if ( not model ) : return None try : instance = model . _default_manager . get ( pk = pk ) return instance except model . ObjectDoesNotExist : pass return None
find an object instance given an app_label .