perm = Permission.objects.create(codename='can_create_' + str(obj.id), name
    ='can edit instance with id ' + str(obj.id))
Django how to define permissions so users can only edit certain model hierarchies?