summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/admin.py1
-rw-r--r--ishtar_common/migrations/0237_data_migration.json158
-rw-r--r--ishtar_common/migrations/0237_data_migration_licenses_shootingangle.py22
-rw-r--r--ishtar_common/tests.py3
4 files changed, 182 insertions, 2 deletions
diff --git a/ishtar_common/admin.py b/ishtar_common/admin.py
index 7cd336ebf..da35fe48c 100644
--- a/ishtar_common/admin.py
+++ b/ishtar_common/admin.py
@@ -2035,7 +2035,6 @@ class ImportColumnValue(admin.ModelAdmin):
list_display = ("import_item", "column")
-
class JsonContentTypeFormMixin(object):
class Meta:
model = models.JsonDataSection
diff --git a/ishtar_common/migrations/0237_data_migration.json b/ishtar_common/migrations/0237_data_migration.json
new file mode 100644
index 000000000..90511ee81
--- /dev/null
+++ b/ishtar_common/migrations/0237_data_migration.json
@@ -0,0 +1,158 @@
+[
+{
+ "model": "ishtar_common.licensetype",
+ "fields": {
+ "label": "Usage interne / non communicable",
+ "txt_idx": "usage-interne-non-communicable",
+ "comment": "",
+ "available": true,
+ "order": 10,
+ "parent": null,
+ "url": null
+ }
+},
+{
+ "model": "ishtar_common.licensetype",
+ "fields": {
+ "label": "Tous droits r\u00e9serv\u00e9s",
+ "txt_idx": "tous-droits-reserves",
+ "comment": "",
+ "available": true,
+ "order": 20,
+ "parent": null,
+ "url": null
+ }
+},
+{
+ "model": "ishtar_common.licensetype",
+ "fields": {
+ "label": "CC-by-sa",
+ "txt_idx": "cc-by-sa",
+ "comment": "",
+ "available": true,
+ "order": 30,
+ "parent": null,
+ "url": null
+ }
+},
+{
+ "model": "ishtar_common.shootingangle",
+ "fields": {
+ "label": "Z\u00e9nithal",
+ "txt_idx": "zenithal",
+ "comment": "",
+ "available": true,
+ "order": 10
+ }
+},
+{
+ "model": "ishtar_common.shootingangle",
+ "fields": {
+ "label": "Oblique",
+ "txt_idx": "oblique",
+ "comment": "",
+ "available": true,
+ "order": 20
+ }
+},
+{
+ "model": "ishtar_common.shootingangle",
+ "fields": {
+ "label": "Depuis le nord",
+ "txt_idx": "depuis-le-nord",
+ "comment": "",
+ "available": true,
+ "order": 30
+ }
+},
+{
+ "model": "ishtar_common.shootingangle",
+ "fields": {
+ "label": "Depuis l\u2019ouest",
+ "txt_idx": "depuis-louest",
+ "comment": "",
+ "available": true,
+ "order": 40
+ }
+},
+{
+ "model": "ishtar_common.shootingangle",
+ "fields": {
+ "label": "Depuis l\u2019est",
+ "txt_idx": "depuis-lest",
+ "comment": "",
+ "available": true,
+ "order": 50
+ }
+},
+{
+ "model": "ishtar_common.shootingangle",
+ "fields": {
+ "label": "Depuis le sud",
+ "txt_idx": "depuis-le-sud",
+ "comment": "",
+ "available": true,
+ "order": 60
+ }
+},
+{
+ "model": "ishtar_common.shootingangle",
+ "fields": {
+ "label": "Depuis le nord-ouest",
+ "txt_idx": "depuis-le-nord-ouest",
+ "comment": "",
+ "available": true,
+ "order": 70
+ }
+},
+{
+ "model": "ishtar_common.shootingangle",
+ "fields": {
+ "label": "Depuis le nord-est",
+ "txt_idx": "depuis-le-nord-est",
+ "comment": "",
+ "available": true,
+ "order": 80
+ }
+},
+{
+ "model": "ishtar_common.shootingangle",
+ "fields": {
+ "label": "Depuis le sud-ouest",
+ "txt_idx": "depuis-le-sud-ouest",
+ "comment": "",
+ "available": true,
+ "order": 90
+ }
+},
+{
+ "model": "ishtar_common.shootingangle",
+ "fields": {
+ "label": "Depuis le sud-est",
+ "txt_idx": "depuis-le-sud-est",
+ "comment": "",
+ "available": true,
+ "order": 100
+ }
+},
+{
+ "model": "ishtar_common.shootingangle",
+ "fields": {
+ "label": "Recto / face",
+ "txt_idx": "recto-face",
+ "comment": "",
+ "available": true,
+ "order": 110
+ }
+},
+{
+ "model": "ishtar_common.shootingangle",
+ "fields": {
+ "label": "Verso / revers",
+ "txt_idx": "verso-revers",
+ "comment": "",
+ "available": true,
+ "order": 120
+ }
+}
+]
diff --git a/ishtar_common/migrations/0237_data_migration_licenses_shootingangle.py b/ishtar_common/migrations/0237_data_migration_licenses_shootingangle.py
new file mode 100644
index 000000000..ec25de658
--- /dev/null
+++ b/ishtar_common/migrations/0237_data_migration_licenses_shootingangle.py
@@ -0,0 +1,22 @@
+# Generated by Django 2.2.24 on 2024-02-10 12:07
+
+import os
+
+from django.db import migrations
+from django.core.management import call_command
+
+
+def load_data(_, __):
+ json_path = os.sep.join(os.path.abspath(__file__).split(os.sep)[:-1] + ["0237_data_migration.json"])
+ call_command("loaddata", json_path)
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('ishtar_common', '0236_auto_20240209_1558'),
+ ]
+
+ operations = [
+ migrations.RunPython(load_data)
+ ]
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py
index 6a2e9d3b0..858692966 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -819,8 +819,9 @@ class SerializationTest(GenericSerializationTest, TestCase):
fixtures = COMMON_FIXTURES + WAREHOUSE_FIXTURES
def create_types(self):
+ # create default when no data is provided
for app, model_name in (
- ("ishtar_common", "LicenseType"),
+ ("archaeological_finds", "MuseumCollection"),
("archaeological_finds", "MaterialTypeQualityType"),
("archaeological_finds", "ObjectTypeQualityType"),
("archaeological_finds", "AlterationType"),