def resolve_labels(cls):
    """
    Returns app, model, app_model, module_app and module_app_model labels for provided class.
    XXX: There has to be a better way to do this.
    """
    labels = {}
    labels['module_app'] = cls.__module__.replace('.models', '')
    labels['app'] = '.'.join(labels['module_app'].split('.')[1:])
    labels['model'] = cls._meta.object_name
    labels['app_model'] = '%s.%s' % (labels['app'], labels['model'])
    labels['module_app_model'] = '%s.%s' % (labels['module_app'], labels[
        'model'])
    return labels
