forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0023_change_stream_descriptions.py
More file actions
45 lines (35 loc) · 1.46 KB
/
0023_change_stream_descriptions.py
File metadata and controls
45 lines (35 loc) · 1.46 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
43
44
# Copyright The IETF Trust 2019-2021, All Rights Reserved
# -*- coding: utf-8 -*-
from django.db import migrations
def forward(apps, schema_editor):
# Change the StreamName descriptions to match what appears in modern RFCs
StreamName = apps.get_model('name', 'StreamName')
for streamName in StreamName.objects.all():
if streamName.name == "IETF":
streamName.desc = "Internent Engineering Task Force (IETF)"
elif streamName.name == "IRTF":
streamName.desc = "Internet Research Task Force (IRTF)"
elif streamName.name == "IAB":
streamName.desc = "Internet Architecture Board (IAB)"
elif streamName.name == "ISE":
streamName.desc = "Independent Submission"
streamName.save()
def reverse(apps, schema_editor):
StreamName = apps.get_model('name', 'StreamName')
for streamName in StreamName.objects.all():
if streamName.name == "IETF":
streamName.desc = "IETF stream"
elif streamName.name == "IRTF":
streamName.desc = "IRTF Stream"
elif streamName.name == "IAB":
streamName.desc = "IAB stream"
elif streamName.name == "ISE":
streamName.desc = "Independent Submission Editor stream"
streamName.save()
class Migration(migrations.Migration):
dependencies = [
('name', '0022_add_liaison_contact_rolenames'),
]
operations = [
migrations.RunPython(forward,reverse),
]