-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1524] Started with making ContactFormSubject model an ordered one
- Loading branch information
Showing
5 changed files
with
77 additions
and
3 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
26 changes: 26 additions & 0 deletions
26
src/open_inwoner/openklant/migrations/0004_auto_20230620_1419.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,26 @@ | ||
# Generated by Django 3.2.15 on 2023-06-20 12:19 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("openklant", "0003_auto_20230526_1013"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name="contactformsubject", | ||
options={ | ||
"verbose_name": "Contact formulier onderwerp", | ||
"verbose_name_plural": "Contact formulier onderwerpen", | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name="contactformsubject", | ||
name="order", | ||
field=models.PositiveIntegerField( | ||
db_index=True, default=0, editable=False, verbose_name="order" | ||
), | ||
), | ||
] |
22 changes: 22 additions & 0 deletions
22
src/open_inwoner/openklant/migrations/0005_auto_20230620_1419.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,22 @@ | ||
# Generated by Django 3.2.15 on 2023-06-20 12:19 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def populate_order_of_subjects(apps, schema_editor): | ||
Subject = apps.get_model("openklant", "ContactFormSubject") | ||
for subject in Subject.objects.all(): | ||
subject.order = subject.pk | ||
subject.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("openklant", "0004_auto_20230620_1419"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython( | ||
populate_order_of_subjects, reverse_code=migrations.RunPython.noop | ||
), | ||
] |
19 changes: 19 additions & 0 deletions
19
src/open_inwoner/openklant/migrations/0006_alter_contactformsubject_order.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,19 @@ | ||
# Generated by Django 3.2.15 on 2023-06-20 14:34 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("openklant", "0005_auto_20230620_1419"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="contactformsubject", | ||
name="order", | ||
field=models.PositiveIntegerField( | ||
db_index=True, editable=False, verbose_name="order" | ||
), | ||
), | ||
] |
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