Chapter - applebiter/gnatwriter GitHub Wiki
The Chapter class represents a chapter of a Story.
Attributes
The attributes that are mapped to the chapters
table in the database:
id: int
The Chapter IDuser_id: int
The ID of the User who created the database entrystory_id: int
The Story IDposition: int
The position of this Chapter among all Chapters in the Story (1-based)title: str
The Chapter titledescription: str
The Chapter description, optionalcreated: str
The creation datetime of the database entry, stored in 'yyyy-mm-dd hh:mm:ss.f' formatmodified: str
The last datetime the Chapter was modified in the database, stored in 'yyyy-mm-dd hh:mm:ss.f' format
The following, complex attributes are returned by the ORM:
user: User
The user who created this database entry. The User is associated with theusers
table in the database.story: Story
The Story to which this Chapter belongs.links: List[ChapterLink]
A list of Links, if any, associated with the Chapter. This attribute is eager-loaded.notes: List[ChapterNote]
A list of Notes, if any, associated with the Chapter. This attribute is eager-loaded.
serialize()
serialize ( ) -> dict
In addition to the attributes mapped to the chapters
table, all data belonging to Scenes, Links, and Notes associated with the Chapter will also be present in the serialized output.