def _resolve_model(obj):
 if (isinstance(obj, six.string_types) and (len(obj.split(u'.')) == 2)):
  (app_name, model_name) = obj.split(u'.')
  resolved_model = apps.get_model(app_name, model_name)
  if (resolved_model is None):
   msg = u'Django did not return a model for {0}.{1}'
   raise ImproperlyConfigured(msg.format(app_name, model_name))
  return resolved_model
 elif (inspect.isclass(obj) and issubclass(obj, models.Model)):
  return obj
 raise ValueError(u'{0} is not a Django model'.format(obj))

def _resolve_model ( obj ) : if ( isinstance ( obj , six . string_types ) and ( len ( obj . split ( u'.' ) ) == 2 ) ) : ( app_name , model_name ) = obj . split ( u'.' ) resolved_model = apps . get_model ( app_name , model_name ) if ( resolved_model is None ) : msg = u'Django did not return a model for {0}.{1}' raise ImproperlyConfigured ( msg . format ( app_name , model_name ) ) return resolved_model elif ( inspect . isclass ( obj ) and issubclass ( obj , models . Model ) ) : return obj raise ValueError ( u'{0} is not a Django model' . format ( obj ) )
resolve supplied obj to a django model class .