(perm_name)
return Permission.objects.get(
        codename=codename,
        content_type__app_label=applabel
    )
由permission获取permission model
由permission获取permission model
由permission获取permission model
def get_perm_model(perm_name):
    """由permission获取permission model"""
    try:
        applabel, codename = perm_name.split(".")
    except:
        applabel = "wechat_django"
        codename = perm_name
    return Permission.objects.get(
        codename=codename,
        content_type__app_label=applabel
    )
def get_perm_model ( perm_name ) : try : applabel , codename = perm_name . split ( "." ) except : applabel = "wechat_django" codename = perm_name return Permission . objects . get ( codename = codename , content_type__app_label = applabel )