-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove editor_label field from ConstraintName model (#3783)
- Loading branch information
1 parent
994e6c3
commit 966e1c8
Showing
4 changed files
with
56 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
ietf/name/migrations/0039_depopulate_constraintname_editor_label.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# 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', 'Δ'), | ||
('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) | ||
] |
17 changes: 17 additions & 0 deletions
17
ietf/name/migrations/0040_remove_constraintname_editor_label.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 2.2.27 on 2022-03-11 10:05 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('name', '0039_depopulate_constraintname_editor_label'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='constraintname', | ||
name='editor_label', | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters