datatracker/ietf/doc/migrations/0006_statements.py
Robert Sparks dbe1749438
feat: IAB statements (#5940)
* feat: support iab and iesg statements. Import iab statements. (#5895)

* feat: infrastructure for statements doctype

* chore: basic test framework

* feat: basic statement document view

* feat: show replaced statements

* chore: black

* fix: state help for statements

* fix: cleanout non-relevant email expansions

* feat: import iab statements, provide group statements tab

* fix: guard against running import twice

* feat: build redirect csv for iab statements

* fix: set document state on import

* feat: show published date on main doc view

* feat: handle pdf statements

* feat: create new and update statements

* chore: copyright block updates

* chore: remove flakes

* chore: black

* feat: add edit/new buttons for the secretariat

* fix: address PR #5895 review comments

* fix: pin pydantic until inflect catches up (#5901) (#5902)

* chore: re-un-pin pydantic
2023-07-23 11:00:24 -07:00

44 lines
1.1 KiB
Python

# Copyright The IETF Trust 2023, All Rights Reserved
from django.db import migrations
def forward(apps, schema_editor):
StateType = apps.get_model("doc", "StateType")
State = apps.get_model("doc", "State")
StateType.objects.create(slug="statement", label="Statement State")
State.objects.create(
slug="active",
type_id="statement",
name="Active",
order=0,
desc="The statement is active",
)
State.objects.create(
slug="replaced",
type_id="statement",
name="Replaced",
order=0,
desc="The statement has been replaced",
)
def reverse(apps, schema_editor):
StateType = apps.get_model("doc", "StateType")
State = apps.get_model("doc", "State")
State.objects.filter(type_id="statement").delete()
StateType.objects.filter(slug="statement").delete()
class Migration(migrations.Migration):
dependencies = [
("doc", "0005_alter_docevent_type"),
("name", "0004_statements"),
]
operations = [
migrations.RunPython(forward, reverse),
]