0018_revert_0017.py 406 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from django.db import migrations
from django.contrib.auth.models import Group, User

def remove_groups(apps, schema_editor):
    groups = ['Jedi', 'Padawan', 'Droid']

    for i in groups:
        Group.objects.filter(name=i).delete()


class Migration(migrations.Migration):

    dependencies = [
        ('rp', '0017_groups'),
    ]

    operations = [
        migrations.RunPython(remove_groups),
    ]