-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor out translation field name list generation, make translation…
… field order consistent, add model translated field unit test, move Portuguese ahead of Arabic, apply unique, primary_key and blank only on translation field for default language, see HEA-141
- Loading branch information
1 parent
9e63b48
commit faa3790
Showing
20 changed files
with
422 additions
and
434 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
153 changes: 153 additions & 0 deletions
153
apps/baseline/migrations/0004_add_translation_fields.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,153 @@ | ||
from django.db import migrations | ||
|
||
import common.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("baseline", "0003_alter_communitylivestock_options"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name="livelihoodzone", | ||
old_name="description", | ||
new_name="description_en", | ||
), | ||
migrations.RenameField( | ||
model_name="livelihoodzone", | ||
old_name="name", | ||
new_name="name_en", | ||
), | ||
migrations.RenameField( | ||
model_name="livelihoodzonebaseline", | ||
old_name="description", | ||
new_name="description_en", | ||
), | ||
migrations.RenameField( | ||
model_name="livelihoodzonebaseline", | ||
old_name="name", | ||
new_name="name_en", | ||
), | ||
migrations.AddField( | ||
model_name="livelihoodzone", | ||
name="description_ar", | ||
field=common.fields.DescriptionField( | ||
blank=True, | ||
help_text="Any extra information or detail that is relevant to the object.", | ||
max_length=2000, | ||
verbose_name="Description", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="livelihoodzone", | ||
name="description_es", | ||
field=common.fields.DescriptionField( | ||
blank=True, | ||
help_text="Any extra information or detail that is relevant to the object.", | ||
max_length=2000, | ||
verbose_name="Description", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="livelihoodzone", | ||
name="description_fr", | ||
field=common.fields.DescriptionField( | ||
blank=True, | ||
help_text="Any extra information or detail that is relevant to the object.", | ||
max_length=2000, | ||
verbose_name="Description", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="livelihoodzone", | ||
name="description_pt", | ||
field=common.fields.DescriptionField( | ||
blank=True, | ||
help_text="Any extra information or detail that is relevant to the object.", | ||
max_length=2000, | ||
verbose_name="Description", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="livelihoodzone", | ||
name="name_ar", | ||
field=common.fields.NameField(blank=True, max_length=200, verbose_name="Name"), | ||
), | ||
migrations.AddField( | ||
model_name="livelihoodzone", | ||
name="name_es", | ||
field=common.fields.NameField(blank=True, max_length=200, verbose_name="Name"), | ||
), | ||
migrations.AddField( | ||
model_name="livelihoodzone", | ||
name="name_fr", | ||
field=common.fields.NameField(blank=True, max_length=200, verbose_name="Name"), | ||
), | ||
migrations.AddField( | ||
model_name="livelihoodzone", | ||
name="name_pt", | ||
field=common.fields.NameField(blank=True, max_length=200, verbose_name="Name"), | ||
), | ||
migrations.AddField( | ||
model_name="livelihoodzonebaseline", | ||
name="description_ar", | ||
field=common.fields.DescriptionField( | ||
blank=True, | ||
help_text="Any extra information or detail that is relevant to the object.", | ||
max_length=2000, | ||
verbose_name="Description", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="livelihoodzonebaseline", | ||
name="description_es", | ||
field=common.fields.DescriptionField( | ||
blank=True, | ||
help_text="Any extra information or detail that is relevant to the object.", | ||
max_length=2000, | ||
verbose_name="Description", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="livelihoodzonebaseline", | ||
name="description_fr", | ||
field=common.fields.DescriptionField( | ||
blank=True, | ||
help_text="Any extra information or detail that is relevant to the object.", | ||
max_length=2000, | ||
verbose_name="Description", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="livelihoodzonebaseline", | ||
name="description_pt", | ||
field=common.fields.DescriptionField( | ||
blank=True, | ||
help_text="Any extra information or detail that is relevant to the object.", | ||
max_length=2000, | ||
verbose_name="Description", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="livelihoodzonebaseline", | ||
name="name_ar", | ||
field=common.fields.NameField(blank=True, max_length=200, verbose_name="Name"), | ||
), | ||
migrations.AddField( | ||
model_name="livelihoodzonebaseline", | ||
name="name_es", | ||
field=common.fields.NameField(blank=True, max_length=200, verbose_name="Name"), | ||
), | ||
migrations.AddField( | ||
model_name="livelihoodzonebaseline", | ||
name="name_fr", | ||
field=common.fields.NameField(blank=True, max_length=200, verbose_name="Name"), | ||
), | ||
migrations.AddField( | ||
model_name="livelihoodzonebaseline", | ||
name="name_pt", | ||
field=common.fields.NameField(blank=True, max_length=200, verbose_name="Name"), | ||
), | ||
] |
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
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.