Lesson.figures: fixed diagrams per lesson (stored once, served with the lesson); gen_lesson_figures; 3 calculus-12 lessons

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-07 16:26:10 +03:30
parent 1d7eb829e2
commit ce629e32e4
9 changed files with 399 additions and 3 deletions

View File

@@ -99,6 +99,11 @@ class Lesson(models.Model):
intro_text = models.TextField()
example = models.TextField(blank=True)
steps = models.JSONField(default=list, blank=True)
# شکل‌های ثابتِ درس: [{"where": "intro"|"example"|"step", "index": n, "diagram": {...}}].
# یک بار با `gen_lesson_figures` ساخته و با چشم تأیید می‌شود و بعد همین‌جا و در
# curriculum.json می‌ماند؛ هنگامِ نمایش هیچ فراخوانیِ مدل و هزینه‌ای نیست.
# `index` فقط برای where='step' است (از صفر). شکل با `rag.services.diagram.validate` گذشته است.
figures = models.JSONField(default=list, blank=True)
# فقط برای kind='video'
video_url = models.URLField(blank=True)