def match_model_string(s):
 match = REDIRECT_TO_RE.match(s)
 if (not match):
  return None
 matches = match.groupdict()
 return (matches[u'app_label'], matches[u'model_name'], int(matches[u'pk']))

def match_model_string ( s ) : match = REDIRECT_TO_RE . match ( s ) if ( not match ) : return None matches = match . groupdict ( ) return ( matches [ u'app_label' ] , matches [ u'model_name' ] , int ( matches [ u'pk' ] ) )
try to parse a string in format "app_label .