Files
MathApp/progress/migrations/0007_tedi_renamed_omega.py
2026-10-10 01:42:44 +03:30

22 lines
1.1 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
همراهِ چهارم از «تدی» به «امگا» (ω) تغییرِ نام داد (خواستِ مالک، ۲۰۲۶-۱۰-۱۰): همه‌ی همراه‌ها
نامِ یک حرفِ یونانیِ ریاضی دارند، و شکلِ گرد با دو گوشِ گردش شبیهِ ω است.
فقط نام عوض می‌شود و فقط اگر هنوز همان «تدی» باشد (ویرایشِ ادمین بازنویسی نمی‌شود). slug همان
`tedi` می‌ماند: شناسه‌ی داخلی است و فرانت با آن شکلک را پیدا می‌کند؛ کاربر آن را نمی‌بیند.
"""
from django.db import migrations
def rename(apps, schema_editor):
apps.get_model('progress', 'Character').objects.filter(slug='tedi', name='تدی').update(name='امگا')
def undo(apps, schema_editor):
apps.get_model('progress', 'Character').objects.filter(slug='tedi', name='امگا').update(name='تدی')
class Migration(migrations.Migration):
dependencies = [('progress', '0006_drop_family_app')]
operations = [migrations.RunPython(rename, undo)]