Skip to content

Commit

Permalink
Merge pull request #20 from uktrade/DST-225-sanctions-regime-initial-…
Browse files Browse the repository at this point in the history
…data-load

DST-225: Add fixture to load sanction regime data
  • Loading branch information
nahmed99 authored Feb 21, 2024
2 parents 646c33c + b01dd82 commit 4a24573
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 1 deletion.
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),
),
]

0 comments on commit 4a24573

Please sign in to comment.