-
Notifications
You must be signed in to change notification settings - Fork 47
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 #165 from rdmorganiser/uri_prefix_obligatory
Make uri prefix obligatory
- Loading branch information
Showing
18 changed files
with
373 additions
and
181 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Generated by Django 2.2.6 on 2019-10-29 12:08 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
def run_data_migration(apps, schema_editor): | ||
for element in apps.get_model('conditions', 'Condition').objects.all(): | ||
element.uri_prefix = element.uri_prefix or settings.DEFAULT_URI_PREFIX | ||
element.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('conditions', '0019_django2'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(run_data_migration), | ||
migrations.AlterField( | ||
model_name='condition', | ||
name='uri_prefix', | ||
field=models.URLField(help_text='The prefix for the URI of this condition.', max_length=256, verbose_name='URI Prefix'), | ||
), | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Generated by Django 2.2.6 on 2019-10-29 12:08 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
def run_data_migration(apps, schema_editor): | ||
for element in apps.get_model('domain', 'Attribute').objects.all(): | ||
element.uri_prefix = element.uri_prefix or settings.DEFAULT_URI_PREFIX | ||
element.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('domain', '0044_mptt'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(run_data_migration), | ||
migrations.AlterField( | ||
model_name='attribute', | ||
name='uri_prefix', | ||
field=models.URLField(help_text='The prefix for the URI of this attribute.', max_length=256, verbose_name='URI Prefix'), | ||
), | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Generated by Django 2.2.6 on 2019-10-29 12:08 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
def run_data_migration(apps, schema_editor): | ||
for element in apps.get_model('options', 'OptionSet').objects.all(): | ||
element.uri_prefix = element.uri_prefix or settings.DEFAULT_URI_PREFIX | ||
element.save() | ||
|
||
for element in apps.get_model('options', 'Option').objects.all(): | ||
element.uri_prefix = element.uri_prefix or settings.DEFAULT_URI_PREFIX | ||
element.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('options', '0022_cascade_options'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(run_data_migration), | ||
migrations.AlterField( | ||
model_name='option', | ||
name='uri_prefix', | ||
field=models.URLField(help_text='The prefix for the URI of this option.', max_length=256, verbose_name='URI Prefix'), | ||
), | ||
migrations.AlterField( | ||
model_name='optionset', | ||
name='uri_prefix', | ||
field=models.URLField(help_text='The prefix for the URI of this option set.', max_length=256, verbose_name='URI Prefix'), | ||
), | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Generated by Django 2.2.6 on 2019-10-29 12:08 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
def run_data_migration(apps, schema_editor): | ||
for element in apps.get_model('questions', 'Catalog').objects.all(): | ||
element.uri_prefix = element.uri_prefix or settings.DEFAULT_URI_PREFIX | ||
element.save() | ||
|
||
for element in apps.get_model('questions', 'Section').objects.all(): | ||
element.uri_prefix = element.uri_prefix or settings.DEFAULT_URI_PREFIX | ||
element.save() | ||
|
||
for element in apps.get_model('questions', 'QuestionSet').objects.all(): | ||
element.uri_prefix = element.uri_prefix or settings.DEFAULT_URI_PREFIX | ||
element.save() | ||
|
||
for element in apps.get_model('questions', 'Question').objects.all(): | ||
element.uri_prefix = element.uri_prefix or settings.DEFAULT_URI_PREFIX | ||
element.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('questions', '0043_django2'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(run_data_migration), | ||
migrations.AlterField( | ||
model_name='catalog', | ||
name='uri_prefix', | ||
field=models.URLField(help_text='The prefix for the URI of this catalog.', max_length=256, verbose_name='URI Prefix'), | ||
), | ||
migrations.AlterField( | ||
model_name='question', | ||
name='uri_prefix', | ||
field=models.URLField(help_text='The prefix for the URI of this question.', max_length=256, verbose_name='URI Prefix'), | ||
), | ||
migrations.AlterField( | ||
model_name='questionset', | ||
name='uri_prefix', | ||
field=models.URLField(help_text='The prefix for the URI of this questionset.', max_length=256, verbose_name='URI Prefix'), | ||
), | ||
migrations.AlterField( | ||
model_name='section', | ||
name='uri_prefix', | ||
field=models.URLField(help_text='The prefix for the URI of this section.', max_length=256, verbose_name='URI Prefix'), | ||
), | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Generated by Django 2.2.6 on 2019-10-29 12:08 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
def run_data_migration(apps, schema_editor): | ||
for element in apps.get_model('tasks', 'Task').objects.all(): | ||
element.uri_prefix = element.uri_prefix or settings.DEFAULT_URI_PREFIX | ||
element.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('tasks', '0023_django2'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(run_data_migration), | ||
migrations.AlterField( | ||
model_name='task', | ||
name='uri_prefix', | ||
field=models.URLField(help_text='The prefix for the URI of this task.', max_length=256, verbose_name='URI Prefix'), | ||
), | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Generated by Django 2.2.6 on 2019-10-29 12:08 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
def run_data_migration(apps, schema_editor): | ||
for element in apps.get_model('views', 'View').objects.all(): | ||
element.uri_prefix = element.uri_prefix or settings.DEFAULT_URI_PREFIX | ||
element.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('views', '0016_django2'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(run_data_migration), | ||
migrations.AlterField( | ||
model_name='view', | ||
name='uri_prefix', | ||
field=models.URLField(help_text='The prefix for the URI of this view.', max_length=256, verbose_name='URI Prefix'), | ||
), | ||
] |
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
Oops, something went wrong.