- content.Subject + Unit.subject, /api/home?subject=, tutor grounded in the chosen book - 5 new books ingested; ~1150 hand-written questions, islands named by hand - node_split: islands over 7 lessons split into parts of <=6 (lesson ids and progress kept) - Lesson.figures hand-authored and visually checked for 653 lessons of the new books; gen_lesson_figures got --subject and survives network errors - seed files re-exported Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
20 lines
1.1 KiB
Python
20 lines
1.1 KiB
Python
from django.db import migrations
|
|
|
|
|
|
def mark_calculus(apps, schema_editor):
|
|
"""
|
|
فصلهای پایهی یازدهم و دوازدهمِ موجود از کتابِ «حسابان»اند (`CALCULUS_11/12`)، نه ریاضیِ عمومی.
|
|
۰۰۱۶ همه را «ریاضی» گذاشت؛ اینجا درست میشود. پایه از `number` شناخته میشود، نه از id.
|
|
بررسینشده: دیتابیسی که در آن فصلِ یازدهم/دوازدهم از کتابی جز حسابان آمده باشد (روی سرور و
|
|
لپتاپ نیست؛ هیچ کتابِ دیگری برای آن پایهها پیش از این migration ingest نشده بود).
|
|
"""
|
|
Subject = apps.get_model('content', 'Subject')
|
|
Unit = apps.get_model('content', 'Unit')
|
|
calculus = Subject.objects.get(key='calculus')
|
|
Unit.objects.filter(grade__number__in=(11, 12)).update(subject=calculus)
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
dependencies = [('content', '0016_unit_subject')]
|
|
operations = [migrations.RunPython(mark_calculus, migrations.RunPython.noop)]
|