AuthorStory - applebiter/gnatwriter GitHub Wiki

The AuthorStory class represents the relationship between an Author and a Story.

Attributes

The attributes associated with the authors_stories table in the database:

  • author_id: int The Author ID
  • story_id: int The Story ID
  • user_id: int The ID of the User who created this AuthorStory entry in the database
  • created: str The creation datetime of the database entry, 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 the users table in the database.
  • author: Author The Author is eager-loaded into the AuthorStory object
  • story: Story The Story to which this AuthorStory belongs.

serialize()

serialize ( ) -> dict Only the attributes mapped to the authors_stories table will be present in the returned dictionary.