

def parse_field_path(field_path):
    '\n    Take a path to a field like "mezzanine.pages.models.Page.feature_image"\n    and return a model key, which is a tuple of the form (\'pages\', \'page\'),\n    and a field name, e.g. "feature_image".\n    '
    (model_path, field_name) = field_path.rsplit('.', 1)
    (app_name, model_name) = model_path.split('.models.')
    (_, app_label) = app_name.rsplit('.', 1)
    return ((app_label, model_name.lower()), field_name)

dataset/ETHPy150Open stephenmcd/mezzanine/mezzanine/boot/__init__.py parse_field_path/original