-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #777 from uktrade/feature/DH-1423-investment-deliv…
…ery-partners Add delivery partners field to investment projects
- Loading branch information
Showing
12 changed files
with
463 additions
and
2 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
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
42 changes: 42 additions & 0 deletions
42
datahub/investment/migrations/0037_add_delivery_partners.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,42 @@ | ||
# Generated by Django 2.0.1 on 2018-01-17 14:24 | ||
|
||
from pathlib import PurePath | ||
|
||
from django.core.management import call_command | ||
from django.db import migrations, models | ||
import uuid | ||
|
||
|
||
def load_initial_delivery_partners(apps, schema_editor): | ||
call_command( | ||
'loaddata', | ||
PurePath(__file__).parent / '0037_initial_delivery_partners.yaml' | ||
) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('investment', '0036_allow_blank_poss_uk_regions'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='InvestmentDeliveryPartner', | ||
fields=[ | ||
('disabled_on', models.DateTimeField(blank=True, null=True)), | ||
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)), | ||
('name', models.TextField(blank=True)), | ||
], | ||
options={ | ||
'ordering': ('name',), | ||
'abstract': False, | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name='investmentproject', | ||
name='delivery_partners', | ||
field=models.ManyToManyField(blank=True, help_text='These are the delivery partner(s) in the region(s) where the project landed.', related_name='_investmentproject_delivery_partners_+', to='investment.InvestmentDeliveryPartner', verbose_name='investment delivery partners'), | ||
), | ||
migrations.RunPython(load_initial_delivery_partners, migrations.RunPython.noop) | ||
] |
Oops, something went wrong.