Skip to content

Commit

Permalink
django upgrade 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
m4ra committed Oct 31, 2023
1 parent d3681b6 commit 7976808
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 2 deletions.
19 changes: 19 additions & 0 deletions apps/images/migrations/0006_alter_customrendition_file.py
Original file line number Diff line number Diff line change
@@ -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'),
),
]
Original file line number Diff line number Diff line change
@@ -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),
),
]
6 changes: 6 additions & 0 deletions apps/measures/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -388,31 +389,36 @@ class MeasuresDetailPage(TranslatedMetadataPageMixin, Page):
max_length=300, blank=True)

districts = MultiSelectField(
max_length=120,
blank=True,
max_choices=3,
choices=BEZIRK_CHOICES,
help_text=_('Up to 3 choices are allowed.')
)

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,
Expand Down
5 changes: 4 additions & 1 deletion changelog/7782.md
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 7976808

Please sign in to comment.