datatracker/ietf/name/migrations/0039_depopulate_constraintname_editor_label.py

40 lines
1.4 KiB
Python

# Generated by Django 2.2.27 on 2022-03-11 07:55
from django.db import migrations
def forward(apps, schema_editor):
pass # nothing to do, row will be dropped
def reverse(apps, schema_editor):
# Restore data from when this migration was written. Dumped with:
# >>> from pprint import pp
# >>> from ietf.name.models import ConstraintName
# >>> pp(list(ConstraintName.objects.values_list('slug', 'editor_label')))
ConstraintName = apps.get_model('name', 'ConstraintName')
for slug, editor_label in [
('conflict', '<span class="encircled">1</span>'),
('conflic2', '<span class="encircled">2</span>'),
('conflic3', '<span class="encircled">3</span>'),
('bethere', '<i class="fa fa-user-o"></i>{count}'),
('timerange', '<i class="fa fa-calendar-o"></i>'),
('time_relation', '&Delta;'),
('wg_adjacent', '<i class="fa fa-step-forward"></i>'),
('chair_conflict', '<i class="fa fa-gavel"></i>'),
('tech_overlap', '<i class="fa fa-rocket"></i>'),
('key_participant', '<i class="fa fa-key"></i>'),
]:
ConstraintName.objects.filter(slug=slug).update(editor_label=editor_label)
class Migration(migrations.Migration):
dependencies = [
('name', '0038_disuse_offagenda_and_reserved'),
]
operations = [
migrations.RunPython(forward, reverse)
]