'Take either a model class or an "app_label.ModelName" string
and return (app_label, object_name).'

def model_to_key(self, model):

    if isinstance(model, str):
        return model.split('.', 1)
    else:
        return (model._meta.app_label, model._meta.object_name)
