forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0018_slidesubmissionstatusname.py
More file actions
42 lines (34 loc) · 1.37 KB
/
0018_slidesubmissionstatusname.py
File metadata and controls
42 lines (34 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Generated by Django 2.2.14 on 2020-08-03 11:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('name', '0017_update_constraintname_order_and_label'),
]
def forward(apps, schema_editor):
SlideSubmissionStatusName = apps.get_model('name', 'SlideSubmissionStatusName')
slide_submission_status_names = [
('pending', 'Pending'),
('approved', 'Approved'),
('rejected', 'Rejected'),
]
for order, (slug, desc) in enumerate(slide_submission_status_names):
SlideSubmissionStatusName.objects.create(slug=slug, name=slug, desc=desc, used=True, order=order)
def reverse(apps, schema_editor):
pass
operations = [
migrations.CreateModel(
name='SlideSubmissionStatusName',
fields=[
('slug', models.CharField(max_length=32, primary_key=True, serialize=False)),
('name', models.CharField(max_length=255)),
('desc', models.TextField(blank=True)),
('used', models.BooleanField(default=True)),
('order', models.IntegerField(default=0)),
],
options={
'ordering': ['order', 'name'],
'abstract': False,
},
),
migrations.RunPython(forward, reverse),
]