def match_model_string(s):
    """
    Try to parse a string in format "app_label.model_name:pk", as is used
    Page.get_link_target()

    Returns a tuple app_label, model_name, pk or None if the string
    does not match the expected format.
    """

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

    Try to parse a string in format "app_label.model_name:pk", as is used
    Page.get_link_target()

    Returns a tuple app_label, model_name, pk or None if the string
    does not match the expected format.
    
feincms/utils/__init__.py