def get_perm(Model, perm):
 ct = ContentType.objects.get_for_model(Model)
 return Permission.objects.get(content_type=ct, codename=perm)

def get_perm ( Model , perm ) : ct = ContentType . objects . get_for_model ( Model ) return Permission . objects . get ( content_type = ct , codename = perm )
return the permission object .