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: intThe Chapter IDuser_id: intThe ID of the User who created the database entrystory_id: intThe Story IDposition: intThe position of this Chapter among all Chapters in the Story (1-based)title: strThe Chapter titledescription: strThe Chapter description, optionalcreated: strThe creation datetime of the database entry, stored in 'yyyy-mm-dd hh:mm:ss.f' formatmodified: strThe 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: UserThe user who created this database entry. The User is associated with theuserstable in the database.story: StoryThe 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.