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:
@@ -126,7 +126,7 @@ def _sync_lesson(node, path, row, ledger, counts):
|
||||
return
|
||||
lesson = Lesson.objects.create(
|
||||
node=node, title=row['title'], intro_text=row['intro_text'],
|
||||
example=row['example'], steps=row['steps'],
|
||||
example=row['example'], steps=row['steps'], figures=row.get('figures') or [],
|
||||
)
|
||||
counts['lessons'] += 1
|
||||
ledger.record(_key('lesson', *path), 'lesson')
|
||||
@@ -154,6 +154,9 @@ def _sync_lesson(node, path, row, ledger, counts):
|
||||
if row.get('steps') and not lesson.steps:
|
||||
lesson.steps = row['steps']
|
||||
changed.append('steps')
|
||||
if row.get('figures') and not lesson.figures:
|
||||
lesson.figures = row['figures']
|
||||
changed.append('figures')
|
||||
if changed:
|
||||
lesson.save(update_fields=changed)
|
||||
counts['updated'] += 1
|
||||
|
||||
Reference in New Issue
Block a user