

def roles_key(user, obj):
    if (obj.__class__ in (User, AnonymousUser)):
        obj_id = get_user_pk(obj)
    else:
        obj_id = obj.pk
    obj_type = str(obj.__class__.__name__).lower()
    obj_counter = get_counter(obj)
    user_id = get_user_pk(user)
    user_counter = get_counter(user)
    return ('%s-%s-%s-%s-%s' % (user_id, user_counter, obj_type, obj_id, obj_counter))

dataset/ETHPy150Open chrisglass/django-rulez/rulez/rolez/cache_helper.py roles_key/original