-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Besoins): Sondage transaction : ajouter une option "Pas encore" (#…
- Loading branch information
Showing
8 changed files
with
142 additions
and
57 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
33 changes: 33 additions & 0 deletions
33
lemarche/tenders/migrations/0084_alter_tender_survey_transactioned_answer.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,33 @@ | ||
# Generated by Django 4.2.9 on 2024-04-08 08:12 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
def transform_boolean_to_char(apps, schema_editor): | ||
Tender = apps.get_model("tenders", "Tender") | ||
for obj in Tender.objects.all(): | ||
if obj.survey_transactioned_answer in [True, "true"]: | ||
obj.survey_transactioned_answer = "1" | ||
elif obj.survey_transactioned_answer in [False, "false"]: | ||
obj.survey_transactioned_answer = "0" | ||
obj.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("tenders", "0083_tendersiae_user"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="tender", | ||
name="survey_transactioned_answer", | ||
field=models.CharField( | ||
blank=True, | ||
choices=[("1", "Oui"), ("0", "Non"), ("?", "Pas encore")], | ||
null=True, | ||
verbose_name="Sondage transaction : réponse", | ||
), | ||
), | ||
migrations.RunPython(transform_boolean_to_char), | ||
] |
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
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
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
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
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
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