MCPcopy
hub / github.com/learnhouse/learnhouse / _make_chapter

Function _make_chapter

apps/api/src/tests/services/test_export_service.py:66–92  ·  view source on GitHub ↗
(db, org, course, *, id: int, chapter_uuid: str, order: int, name: str)

Source from the content-addressed store, hash-verified

64
65
66async def _make_chapter(db, org, course, *, id: int, chapter_uuid: str, order: int, name: str):
67 chapter = Chapter(
68 id=id,
69 name=name,
70 description=f"Description for {name}",
71 org_id=org.id,
72 course_id=course.id,
73 chapter_uuid=chapter_uuid,
74 thumbnail_image=f"{chapter_uuid}.png",
75 creation_date=str(datetime.now()),
76 update_date=str(datetime.now()),
77 )
78 db.add(chapter)
79 await db.commit()
80 await db.refresh(chapter)
81 db.add(
82 CourseChapter(
83 chapter_id=chapter.id,
84 course_id=course.id,
85 org_id=org.id,
86 order=order,
87 creation_date=str(datetime.now()),
88 update_date=str(datetime.now()),
89 )
90 )
91 await db.commit()
92 return chapter
93
94
95async def _make_activity(

Calls 3

ChapterClass · 0.90
CourseChapterClass · 0.90
commitMethod · 0.80

Tested by

no test coverage detected