def resolve_model_string(model_string, default_app=None):
 if isinstance(model_string, string_types):
  try:
   (app_label, model_name) = model_string.split(u'.')
  except ValueError:
   if (default_app is not None):
    app_label = default_app
    model_name = model_string
   else:
    raise ValueError(u'Can not resolve {0!r} into a model. Model names should be in the form app_label.model_name'.format(model_string), model_string)
  return apps.get_model(app_label, model_name)
 elif (isinstance(model_string, type) and issubclass(model_string, Model)):
  return model_string
 else:
  raise ValueError(u'Can not resolve {0!r} into a model'.format(model_string), model_string)

def resolve_model_string ( model_string , default_app = None ) : if isinstance ( model_string , string_types ) : try : ( app_label , model_name ) = model_string . split ( u'.' ) except ValueError : if ( default_app is not None ) : app_label = default_app model_name = model_string else : raise ValueError ( u'Can not resolve {0!r} into a model. Model names should be in the form app_label.model_name' . format ( model_string ) , model_string ) return apps . get_model ( app_label , model_name ) elif ( isinstance ( model_string , type ) and issubclass ( model_string , Model ) ) : return model_string else : raise ValueError ( u'Can not resolve {0!r} into a model' . format ( model_string ) , model_string )
resolve an app_label .