def handle(self, *args, **options): create_groups() create_permissions() for group_name, code_names in GROUP_PERMISSIONS.iteritems(): group = Group.objects.get(name=group_name) group_permissions = [] for codename in code_names: group_permissions.append(Permission.objects.get(codename=codename)) group.permissions = group_permissions group.save()
def handle(self, *args, **options): create_groups() create_permissions() for group_name, code_names in GROUP_PERMISSIONS.iteritems(): group = Group.objects.get(name=group_name) group_permissions = [] for codename in code_names: group_permissions.append( Permission.objects.get(codename=codename)) group.permissions = group_permissions group.save()
def setUpClass(cls): create_groups() create_permissions() call_command('setup_permissions')