From 7976808b0264c72226906d863abadf0dc22eaa00 Mon Sep 17 00:00:00 2001 From: Mara Karagianni Date: Tue, 31 Oct 2023 14:57:35 +0200 Subject: [PATCH] django upgrade 4.1 --- .../0006_alter_customrendition_file.py | 19 +++++++++ ...r_measuresdetailpage_districts_and_more.py | 39 +++++++++++++++++++ apps/measures/models.py | 6 +++ changelog/7782.md | 5 ++- requirements/base.txt | 2 +- 5 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 apps/images/migrations/0006_alter_customrendition_file.py create mode 100644 apps/measures/migrations/0014_alter_measuresdetailpage_districts_and_more.py diff --git a/apps/images/migrations/0006_alter_customrendition_file.py b/apps/images/migrations/0006_alter_customrendition_file.py new file mode 100644 index 00000000..9f76419f --- /dev/null +++ b/apps/images/migrations/0006_alter_customrendition_file.py @@ -0,0 +1,19 @@ +# Generated by Django 4.2 on 2023-10-31 14:06 + +from django.db import migrations +import wagtail.images.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('apps_images', '0005_auto_20231025_1401'), + ] + + operations = [ + migrations.AlterField( + model_name='customrendition', + name='file', + field=wagtail.images.models.WagtailImageField(height_field='height', storage=wagtail.images.models.get_rendition_storage, upload_to=wagtail.images.models.get_rendition_upload_to, width_field='width'), + ), + ] diff --git a/apps/measures/migrations/0014_alter_measuresdetailpage_districts_and_more.py b/apps/measures/migrations/0014_alter_measuresdetailpage_districts_and_more.py new file mode 100644 index 00000000..ad7346db --- /dev/null +++ b/apps/measures/migrations/0014_alter_measuresdetailpage_districts_and_more.py @@ -0,0 +1,39 @@ +# Generated by Django 4.2 on 2023-10-31 14:16 + +from django.db import migrations +import multiselectfield.db.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('apps_measures', '0013_alter_measuresdetailpage_inclusive_shaping_of_urban_life'), + ] + + operations = [ + migrations.AlterField( + model_name='measuresdetailpage', + name='districts', + field=multiselectfield.db.fields.MultiSelectField(blank=True, choices=[('1', 'citywide'), ('2', 'Charlottenburg-Wilmersdorf'), ('3', 'Friedrichshain-Kreuzberg'), ('4', 'Lichtenberg'), ('5', 'Marzahn-Hellersdorf'), ('6', 'Mitte'), ('7', 'Neukölln'), ('8', 'Pankow'), ('9', 'Reinickendorf'), ('10', 'Spandau'), ('11', 'Steglitz-Zehlendorf'), ('12', 'Tempelhof-Schöneberg'), ('13', 'Treptow-Köpenick')], help_text='Up to 3 choices are allowed.', max_length=120), + ), + migrations.AlterField( + model_name='measuresdetailpage', + name='facilitative_administration', + field=multiselectfield.db.fields.MultiSelectField(blank=True, choices=[('1', 'Effective Administrative Processes'), ('2', 'Transparent and Innovative Procurement'), ('3', 'Intelligent Data Use'), ('4', 'Fail-Safe Critical and Digital Infrastructure')], max_length=120), + ), + migrations.AlterField( + model_name='measuresdetailpage', + name='future_opportunities_for_all', + field=multiselectfield.db.fields.MultiSelectField(blank=True, choices=[('1', 'Capacities for Change'), ('2', 'Meeting and Learning Places'), ('3', 'Liveable Urban Development'), ('4', 'Smart Cities Learning Together')], max_length=120), + ), + migrations.AlterField( + model_name='measuresdetailpage', + name='inclusive_shaping_of_urban_life', + field=multiselectfield.db.fields.MultiSelectField(blank=True, choices=[('1', 'Participatory Governance'), ('2', 'Transparent Decision Processes'), ('3', 'Citizen Services'), ('4', 'Digital Citizens Rights and Privacy')], max_length=120), + ), + migrations.AlterField( + model_name='measuresdetailpage', + name='regenerative_management', + field=multiselectfield.db.fields.MultiSelectField(blank=True, choices=[('1', 'Smart Economic Models'), ('2', 'IT Ecosystems'), ('3', 'Smart Capital Region'), ('4', 'Regeneration of Natural Resources')], max_length=120), + ), + ] diff --git a/apps/measures/models.py b/apps/measures/models.py index 22d30159..a9e15727 100644 --- a/apps/measures/models.py +++ b/apps/measures/models.py @@ -366,6 +366,7 @@ def get_context(self, request): class MeasuresDetailPage(TranslatedMetadataPageMixin, Page): + page_title_de = models.CharField( max_length=120, blank=False) page_title_en = models.CharField( @@ -388,6 +389,7 @@ class MeasuresDetailPage(TranslatedMetadataPageMixin, Page): max_length=300, blank=True) districts = MultiSelectField( + max_length=120, blank=True, max_choices=3, choices=BEZIRK_CHOICES, @@ -395,24 +397,28 @@ class MeasuresDetailPage(TranslatedMetadataPageMixin, Page): ) regenerative_management = MultiSelectField( + max_length=120, blank=True, max_choices=3, choices=REGENERATIVE_MANAGEMENT, ) future_opportunities_for_all = MultiSelectField( + max_length=120, blank=True, max_choices=3, choices=FUTURE_OPPORTUNITIES_FOR_ALL, ) inclusive_shaping_of_urban_life = MultiSelectField( + max_length=120, blank=True, max_choices=3, choices=INCLUSIVE_SHAPING_OF_URBAN_LIFE, ) facilitative_administration = MultiSelectField( + max_length=120, blank=True, max_choices=3, choices=FACILITATIVE_ADMINISTRATION, diff --git a/changelog/7782.md b/changelog/7782.md index cb5392b6..922c6dff 100644 --- a/changelog/7782.md +++ b/changelog/7782.md @@ -1,7 +1,10 @@ ### Updated - - Django from 3.2.19 to 4.0 + - Django from 3.2.19 to 4.0 - apps: remove deprecated app config in apps init - settings: LN10N is now enabled by default - templates: ifequal not supported + - Django from 4.0 to 4.1 + - apps: added max_length in multiselectfield to fix index error with + validators[0]=MaxValueMultiFieldValidator(self.max_length) diff --git a/requirements/base.txt b/requirements/base.txt index 8362cf39..88874ed5 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,5 +1,5 @@ brotli==1.1.0 -Django==4.0 +Django==4.1 django-cloudflare-push==0.2.2 django-csp==3.7 django-multiselectfield==0.1.12