Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DST-225: Add fixture to load sanction regime data #20

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions fixtures.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
# Load all fixtures in one go

echo "Loading all fixture data"

python manage.py loaddata report_a_breach/fixtures/*.json

echo "Fixtures loaded"
2 changes: 1 addition & 1 deletion report_a_breach/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class SanctionsRegimeBreachThrough(BaseModel):
class SanctionsRegime(BaseModel):
short_name = models.TextField()
full_name = models.TextField()
date_range = DateRangeField
date_range = DateRangeField(blank=True, null=True)


class UploadedDocument(BaseModel):
Expand Down
56 changes: 56 additions & 0 deletions report_a_breach/fixtures/sanctions_regimes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[
{
"model": "report_a_breach.SanctionsRegime",
"pk": "cf6b54c5-a46b-4b7d-a40d-9f2ed750eb6d",
"fields": {
"short_name": "The Afghanistan",
"full_name": "The Afghanistan (Sanctions) (EU Exit) Regulations 2020",
"date_range": ""
}
},
{
"model": "report_a_breach.SanctionsRegime",
"pk": "708e45bf-838b-4efc-b302-6d31d5684e7b",
"fields": {
"short_name": "The Republic of Belarus",
"full_name": "The Republic of Belarus (Sanctions) (EU Exit) Regulations 2019",
"date_range": ""
}
},
{
"model": "report_a_breach.SanctionsRegime",
"pk": "10cb44e9-fcdf-4fe5-89e8-798b5192b766",
"fields": {
"short_name": "The Burma",
"full_name": "The Burma (Sanctions) (EU Exit) Regulations 2019",
"date_range": ""
}
},
{
"model": "report_a_breach.SanctionsRegime",
"pk": "1f7f89b3-b574-4fd9-9904-d7701865c5a1",
"fields": {
"short_name": "The Democratic People’s Republic of Korea",
"full_name": "The Democratic People’s Republic of Korea (Sanctions) (EU Exit) Regulations 2019",
"date_range": ""
}
},
{
"model": "report_a_breach.SanctionsRegime",
"pk": "fef50ac9-ecbc-454b-915f-d5aa4953a2f8",
"fields": {
"short_name": "The Iran",
"full_name": "The Iran Human Rights (Sanctions) (EU Exit) Regulations 2019",
"date_range": ""
}
},
{
"model": "report_a_breach.SanctionsRegime",
"pk": "0f3d1e25-638c-41b7-89df-4e569b45297f",
"fields": {
"short_name": "The Russia",
"full_name": "The Russia (Sanctions) (EU Exit) Regulations 2019",
"date_range": ""
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 4.2.10 on 2024-02-20 16:37

import django.contrib.postgres.fields.ranges
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("report_a_breach", "0002_breach_what_were_the_goods_and_more"),
]

operations = [
migrations.AddField(
model_name="historicalbreach",
name="what_were_the_goods",
field=models.TextField(
default="",
verbose_name="What were the goods or services, or what was the technological assistance or technology?",
),
preserve_default=False,
),
migrations.AddField(
model_name="historicalsanctionsregime",
name="date_range",
field=django.contrib.postgres.fields.ranges.DateRangeField(blank=True, null=True),
),
migrations.AddField(
model_name="sanctionsregime",
name="date_range",
field=django.contrib.postgres.fields.ranges.DateRangeField(blank=True, null=True),
),
]