Character - applebiter/gnatwriter GitHub Wiki

The Character class represents a character in one or more stories.

Attributes

The attributes that are mapped to the characters table in the database:

  • id: int The Character ID
  • user_id: int The ID of the User who created the character entry in the database
  • title: str The character's title, if any
  • honorific: str The character's preferred honorific, such as Mr., Mrs., or Ms., for example
  • first_name: str The character's first name
  • middle_name: str The character's middle name(s), if any
  • last_name: str The character's last name, if any
  • nickname: str The character's nickname, if any
  • gender: str The character's gender, if specified
  • sex: str The character's sex, if specified
  • ethnicity: str The character's ethnicity, if specified
  • race: str The character's race, if specified
  • tribe_or_clan: str The character's tribe or clan, if specified
  • nationality: str The character's nationality, if specified
  • religion: str The character's religion, if specified
  • occupation: str The character's occupation, if specified
  • education: str The character's education, if specified
  • marital_status: str The character's marital status, if specified
  • children: bool Whether or not the character has any children
  • date_of_birth: str The character's date of birth in the format yyyy-mm-dd, if specified
  • date_of_death: str The character's date of death in the format yyyy-mm-dd, if specified
  • description: str A description of the character
  • mbti: str The character's Myers-Briggs Type Indicator, if specified
  • enneagram: str The character's Enneagram Type, if specified
  • wounds: str The conditions or events of the character's life that is the cause of emotional pain
  • created: str This is actually a Python Datetime object except for input and output
  • modified: str This is also a Python Datetime object and is updated with every update of the Character

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.
  • character_relationships: List[Characterrelationship] A list of relationships to other characters, if any
  • traits: List[CharacterTrait] A list of traits and their magnitudes, if any
  • events: List[CharacterEvents] A list of events with which the character is associated, if any
  • images: List[CharacterImage] A list of images associated with the character, if any
  • links: List[CharacterLink] A list of links, if any, associated with the character. This attribute is eager-loaded.
  • notes: List[CharacterNote] A list of notes, if any, associated with the character. This attribute is eager-loaded.
  • stories: List[CharacterStory] A list of references to any stories in which this character appears

The following properties are computed from existing attribute values:

  • age: int Returns the age of the character when they died if the date of death is defined, otherwise returns the current age. This is a virtual @property
  • full_name: str Returns a string composed of the name components as they are defined. This is a virtual @property

serialize()

serialize ( ) -> dict In addition to the attributes mapped to the characters database table, associated relationships, traits, events, images, links, and notes will be present in the returned dictionary.