mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-03 16:32:15 +02:00
Populate fed agency seed data
This commit is contained in:
parent
7b5beba813
commit
d62e95fd10
2 changed files with 15 additions and 0 deletions
|
@ -1,7 +1,14 @@
|
|||
# Generated by Django 4.2.10 on 2024-03-19 05:42
|
||||
# This migration seeds the federal agency table with initial data and manually calls
|
||||
# FederalAgency.create_federal_agencies to populate initial table values.
|
||||
|
||||
from django.db import migrations, models
|
||||
from registrar.models import FederalAgency
|
||||
from typing import Any
|
||||
|
||||
# For linting: RunPython expects a function reference.
|
||||
def create_federal_agencies(apps, schema_editor) -> Any:
|
||||
FederalAgency.create_federal_agencies(apps, schema_editor)
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
|
@ -23,4 +30,9 @@ class Migration(migrations.Migration):
|
|||
"verbose_name_plural": "Federal agencies",
|
||||
},
|
||||
),
|
||||
migrations.RunPython(
|
||||
create_federal_agencies,
|
||||
reverse_code=migrations.RunPython.noop,
|
||||
atomic=True,
|
||||
),
|
||||
]
|
||||
|
|
|
@ -17,6 +17,9 @@ class FederalAgency(TimeStampedModel):
|
|||
help_text="Federal agency",
|
||||
)
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.agency
|
||||
|
||||
# TODO: Update parameters to put in
|
||||
def create_federal_agencies(apps, schema_editor):
|
||||
"""This method gets run from a data migration."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue