-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alireza Asadi
committed
Nov 2, 2024
1 parent
e8e906d
commit 5e16448
Showing
1 changed file
with
32 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Generated by Django 5.0.1 on 2024-10-26 10:03 | ||
|
||
from django.db import migrations, models | ||
from api.models import SubmitStatus | ||
|
||
def set_initial_submit_status_for_existing_notes_summaries(apps, schema_editor): | ||
Note = apps.get_model('api', 'Note') | ||
Summary = apps.get_model('api', 'Summary') | ||
|
||
Note.objects.filter(submit_status=SubmitStatus.DRAFT).update(submit_status=SubmitStatus.INITIAL_SUBMIT) | ||
Summary.objects.filter(submit_status=SubmitStatus.DRAFT).update(submit_status=SubmitStatus.INITIAL_SUBMIT) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0033_noteuseraccess_can_view_summary_initialize'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='note', | ||
name='submit_status', | ||
field=models.IntegerField(choices=[(0, 'درفت'), (1, 'ثبت اولیه'), (2, 'ثبت نهایی')], default=0, verbose_name='وضعیت'), | ||
), | ||
migrations.AddField( | ||
model_name='summary', | ||
name='submit_status', | ||
field=models.IntegerField(choices=[(0, 'درفت'), (1, 'ثبت اولیه'), (2, 'ثبت نهایی')], default=0, verbose_name='وضعیت'), | ||
), | ||
migrations.RunPython(set_initial_submit_status_for_existing_notes_summaries), | ||
] |