diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-09-16 19:04:34 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-09-16 19:04:34 +0200 |
| commit | fd5e330ede426a7152deab41620b6a60b63df220 (patch) | |
| tree | 02fb227e93c929db6dc4a3d6ef254516bdc6f2fe /archaeological_context_records/migrations | |
| parent | 0f88ac0c7abd4ecb5e9bed54474af23752efcbcd (diff) | |
| download | Ishtar-fd5e330ede426a7152deab41620b6a60b63df220.tar.bz2 Ishtar-fd5e330ede426a7152deab41620b6a60b63df220.zip | |
🗃️ context records new fields, default values, admin interface - town add notice (refs #6024)
Town:
- notice
Context records:
- excavated length
- excavated width
- structure
- texture
- colors
- details on colors
- inclusions
Diffstat (limited to 'archaeological_context_records/migrations')
3 files changed, 472 insertions, 0 deletions
diff --git a/archaeological_context_records/migrations/0118_context_record_new_fields_new_types.py b/archaeological_context_records/migrations/0118_context_record_new_fields_new_types.py new file mode 100644 index 000000000..fc79df86d --- /dev/null +++ b/archaeological_context_records/migrations/0118_context_record_new_fields_new_types.py @@ -0,0 +1,139 @@ +# Generated by Django 2.2.24 on 2024-09-16 17:22 + +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion +import ishtar_common.models_common +import re + + +class Migration(migrations.Migration): + + dependencies = [ + ('archaeological_context_records', '0117_identification_m2m'), + ] + + operations = [ + migrations.AddField( + model_name='contextrecord', + name='details_on_color', + field=models.TextField(blank=True, default='', verbose_name='Details on color'), + ), + migrations.AddField( + model_name='contextrecord', + name='excavated_length', + field=models.FloatField(blank=True, null=True, verbose_name='Excavated length (m)'), + ), + migrations.AddField( + model_name='contextrecord', + name='excavated_width', + field=models.FloatField(blank=True, null=True, verbose_name='Excavated width (m)'), + ), + migrations.AddField( + model_name='historicalcontextrecord', + name='details_on_color', + field=models.TextField(blank=True, default='', verbose_name='Details on color'), + ), + migrations.AddField( + model_name='historicalcontextrecord', + name='excavated_length', + field=models.FloatField(blank=True, null=True, verbose_name='Excavated length (m)'), + ), + migrations.AddField( + model_name='historicalcontextrecord', + name='excavated_width', + field=models.FloatField(blank=True, null=True, verbose_name='Excavated width (m)'), + ), + migrations.CreateModel( + name='TextureType', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('label', models.TextField(verbose_name='Label')), + ('txt_idx', models.TextField(help_text='The slug is the standardized version of the name. It contains only lowercase letters, numbers and hyphens. Each slug must be unique.', unique=True, validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+\\Z'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')], verbose_name='Textual ID')), + ('comment', models.TextField(blank=True, default='', verbose_name='Comment')), + ('available', models.BooleanField(default=True, verbose_name='Available')), + ('order', models.IntegerField(default=10, verbose_name='Order')), + ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='archaeological_context_records.TextureType', verbose_name='Parent')), + ], + options={ + 'verbose_name': 'Texture Type', + 'verbose_name_plural': 'Texture Types', + 'ordering': ('order', 'label'), + }, + bases=(ishtar_common.models_common.Cached, models.Model), + ), + migrations.CreateModel( + name='StructureType', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('label', models.TextField(verbose_name='Label')), + ('txt_idx', models.TextField(help_text='The slug is the standardized version of the name. It contains only lowercase letters, numbers and hyphens. Each slug must be unique.', unique=True, validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+\\Z'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')], verbose_name='Textual ID')), + ('comment', models.TextField(blank=True, default='', verbose_name='Comment')), + ('available', models.BooleanField(default=True, verbose_name='Available')), + ('order', models.IntegerField(default=10, verbose_name='Order')), + ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='archaeological_context_records.StructureType', verbose_name='Parent')), + ], + options={ + 'verbose_name': 'Structure Type', + 'verbose_name_plural': 'Structure Types', + 'ordering': ('order', 'label'), + }, + bases=(ishtar_common.models_common.Cached, models.Model), + ), + migrations.CreateModel( + name='InclusionType', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('label', models.TextField(verbose_name='Label')), + ('txt_idx', models.TextField(help_text='The slug is the standardized version of the name. It contains only lowercase letters, numbers and hyphens. Each slug must be unique.', unique=True, validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+\\Z'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')], verbose_name='Textual ID')), + ('comment', models.TextField(blank=True, default='', verbose_name='Comment')), + ('available', models.BooleanField(default=True, verbose_name='Available')), + ('order', models.IntegerField(default=10, verbose_name='Order')), + ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='archaeological_context_records.InclusionType', verbose_name='Parent')), + ], + options={ + 'verbose_name': 'Inclusion Type', + 'verbose_name_plural': 'Inclusion Types', + 'ordering': ('order', 'label'), + }, + bases=(ishtar_common.models_common.Cached, models.Model), + ), + migrations.CreateModel( + name='ColorType', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('label', models.TextField(verbose_name='Label')), + ('txt_idx', models.TextField(help_text='The slug is the standardized version of the name. It contains only lowercase letters, numbers and hyphens. Each slug must be unique.', unique=True, validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+\\Z'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')], verbose_name='Textual ID')), + ('comment', models.TextField(blank=True, default='', verbose_name='Comment')), + ('available', models.BooleanField(default=True, verbose_name='Available')), + ('order', models.IntegerField(default=10, verbose_name='Order')), + ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='archaeological_context_records.ColorType', verbose_name='Parent')), + ], + options={ + 'verbose_name': 'Color Type', + 'verbose_name_plural': 'Color Types', + 'ordering': ('order', 'label'), + }, + bases=(ishtar_common.models_common.Cached, models.Model), + ), + migrations.AddField( + model_name='contextrecord', + name='colors', + field=models.ManyToManyField(blank=True, to='archaeological_context_records.ColorType'), + ), + migrations.AddField( + model_name='contextrecord', + name='inclusions', + field=models.ManyToManyField(blank=True, to='archaeological_context_records.InclusionType'), + ), + migrations.AddField( + model_name='contextrecord', + name='structures', + field=models.ManyToManyField(blank=True, to='archaeological_context_records.StructureType'), + ), + migrations.AddField( + model_name='contextrecord', + name='textures', + field=models.ManyToManyField(blank=True, to='archaeological_context_records.TextureType'), + ), + ] diff --git a/archaeological_context_records/migrations/0119_default_typos.json b/archaeological_context_records/migrations/0119_default_typos.json new file mode 100644 index 000000000..2a1c508d2 --- /dev/null +++ b/archaeological_context_records/migrations/0119_default_typos.json @@ -0,0 +1,310 @@ +[ +{ + "model": "archaeological_context_records.structuretype", + "fields": { + "label": "Homog\u00e8ne", + "txt_idx": "homogeneous", + "comment": "", + "available": true, + "order": 10, + "parent": null + } +}, +{ + "model": "archaeological_context_records.structuretype", + "fields": { + "label": "H\u00e9t\u00e9rog\u00e8ne", + "txt_idx": "heterogeneous", + "comment": "", + "available": true, + "order": 20, + "parent": null + } +}, +{ + "model": "archaeological_context_records.structuretype", + "fields": { + "label": "Compacte", + "txt_idx": "compact", + "comment": "", + "available": true, + "order": 30, + "parent": null + } +}, +{ + "model": "archaeological_context_records.structuretype", + "fields": { + "label": "Meuble", + "txt_idx": "loose", + "comment": "", + "available": true, + "order": 40, + "parent": null + } +}, +{ + "model": "archaeological_context_records.structuretype", + "fields": { + "label": "Particulaire", + "txt_idx": "particular", + "comment": "", + "available": true, + "order": 50, + "parent": null + } +}, +{ + "model": "archaeological_context_records.structuretype", + "fields": { + "label": "Grumeleuse", + "txt_idx": "lumpy", + "comment": "", + "available": true, + "order": 60, + "parent": null + } +}, +{ + "model": "archaeological_context_records.structuretype", + "fields": { + "label": "Poly\u00e9drique", + "txt_idx": "polyedral", + "comment": "", + "available": true, + "order": 70, + "parent": null + } +}, +{ + "model": "archaeological_context_records.structuretype", + "fields": { + "label": "Massive", + "txt_idx": "massive", + "comment": "", + "available": true, + "order": 80, + "parent": null + } +}, +{ + "model": "archaeological_context_records.texturetype", + "fields": { + "label": "Argile", + "txt_idx": "clay", + "comment": "", + "available": true, + "order": 10, + "parent": null + } +}, +{ + "model": "archaeological_context_records.texturetype", + "fields": { + "label": "Limons", + "txt_idx": "silt", + "comment": "", + "available": true, + "order": 20, + "parent": null + } +}, +{ + "model": "archaeological_context_records.texturetype", + "fields": { + "label": "Sables", + "txt_idx": "sand", + "comment": "", + "available": true, + "order": 30, + "parent": null + } +}, +{ + "model": "archaeological_context_records.texturetype", + "fields": { + "label": "Graviers", + "txt_idx": "gravel", + "comment": "", + "available": true, + "order": 40, + "parent": null + } +}, +{ + "model": "archaeological_context_records.texturetype", + "fields": { + "label": "Cailloutis", + "txt_idx": "pebbles", + "comment": "", + "available": true, + "order": 50, + "parent": null + } +}, +{ + "model": "archaeological_context_records.colortype", + "fields": { + "label": "Jaune", + "txt_idx": "yellow", + "comment": "", + "available": true, + "order": 10, + "parent": null + } +}, +{ + "model": "archaeological_context_records.colortype", + "fields": { + "label": "Beige", + "txt_idx": "beige", + "comment": "", + "available": true, + "order": 20, + "parent": null + } +}, +{ + "model": "archaeological_context_records.colortype", + "fields": { + "label": "Ocre", + "txt_idx": "ochre", + "comment": "", + "available": true, + "order": 30, + "parent": null + } +}, +{ + "model": "archaeological_context_records.colortype", + "fields": { + "label": "Orange", + "txt_idx": "orange", + "comment": "", + "available": true, + "order": 40, + "parent": null + } +}, +{ + "model": "archaeological_context_records.colortype", + "fields": { + "label": "Rouge", + "txt_idx": "red", + "comment": "", + "available": true, + "order": 50, + "parent": null + } +}, +{ + "model": "archaeological_context_records.colortype", + "fields": { + "label": "Brun", + "txt_idx": "brown", + "comment": "", + "available": true, + "order": 60, + "parent": null + } +}, +{ + "model": "archaeological_context_records.colortype", + "fields": { + "label": "Gris", + "txt_idx": "grey", + "comment": "", + "available": true, + "order": 70, + "parent": null + } +}, +{ + "model": "archaeological_context_records.colortype", + "fields": { + "label": "Blanc", + "txt_idx": "white", + "comment": "", + "available": true, + "order": 80, + "parent": null + } +}, +{ + "model": "archaeological_context_records.colortype", + "fields": { + "label": "Autre", + "txt_idx": "other", + "comment": "", + "available": true, + "order": 90, + "parent": null + } +}, +{ + "model": "archaeological_context_records.inclusiontype", + "fields": { + "label": "Cendre", + "txt_idx": "ash", + "comment": "", + "available": true, + "order": 10, + "parent": null + } +}, +{ + "model": "archaeological_context_records.inclusiontype", + "fields": { + "label": "Charbons", + "txt_idx": "coals", + "comment": "", + "available": true, + "order": 20, + "parent": null + } +}, +{ + "model": "archaeological_context_records.inclusiontype", + "fields": { + "label": "Cailloutis", + "txt_idx": "pebbles", + "comment": "", + "available": true, + "order": 30, + "parent": null + } +}, +{ + "model": "archaeological_context_records.inclusiontype", + "fields": { + "label": "Blocs", + "txt_idx": "boulders", + "comment": "", + "available": true, + "order": 40, + "parent": null + } +}, +{ + "model": "archaeological_context_records.inclusiontype", + "fields": { + "label": "Racines", + "txt_idx": "roots", + "comment": "", + "available": true, + "order": 50, + "parent": null + } +}, +{ + "model": "archaeological_context_records.inclusiontype", + "fields": { + "label": "Autre", + "txt_idx": "other", + "comment": "", + "available": true, + "order": 60, + "parent": null + } +} +] diff --git a/archaeological_context_records/migrations/0119_default_typos.py b/archaeological_context_records/migrations/0119_default_typos.py new file mode 100644 index 000000000..10cdab665 --- /dev/null +++ b/archaeological_context_records/migrations/0119_default_typos.py @@ -0,0 +1,23 @@ +# Generated by Django 2.2.24 on 2024-03-25 17:24 + +from django.db import migrations +from ishtar_common.utils import migrations_load_data + +COLOR_WARNING = "\033[93m" +COLOR_ENDC = "\033[0m" + + +def load_data(_, __): + migrations_load_data("archaeological_context_records", + "0119_default_typos.json") + + +class Migration(migrations.Migration): + + dependencies = [ + ('archaeological_context_records', '0118_context_record_new_fields_new_types'), + ] + + operations = [ + migrations.RunPython(load_data) + ]
\ No newline at end of file |
