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: intThe Character IDuser_id: intThe ID of the User who created the character entry in the databasetitle: strThe character's title, if anyhonorific: strThe character's preferred honorific, such as Mr., Mrs., or Ms., for examplefirst_name: strThe character's first namemiddle_name: strThe character's middle name(s), if anylast_name: strThe character's last name, if anynickname: strThe character's nickname, if anygender: strThe character's gender, if specifiedsex: strThe character's sex, if specifiedethnicity: strThe character's ethnicity, if specifiedrace: strThe character's race, if specifiedtribe_or_clan: strThe character's tribe or clan, if specifiednationality: strThe character's nationality, if specifiedreligion: strThe character's religion, if specifiedoccupation: strThe character's occupation, if specifiededucation: strThe character's education, if specifiedmarital_status: strThe character's marital status, if specifiedchildren: boolWhether or not the character has any childrendate_of_birth: strThe character's date of birth in the format yyyy-mm-dd, if specifieddate_of_death: strThe character's date of death in the format yyyy-mm-dd, if specifieddescription: strA description of the charactermbti: strThe character's Myers-Briggs Type Indicator, if specifiedenneagram: strThe character's Enneagram Type, if specifiedwounds: strThe conditions or events of the character's life that is the cause of emotional paincreated: strThis is actually a Python Datetime object except for input and outputmodified: strThis 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: UserThe user who created this database entry. The User is associated with theuserstable in the database.character_relationships: List[Characterrelationship]A list of relationships to other characters, if anytraits: List[CharacterTrait]A list of traits and their magnitudes, if anyevents: List[CharacterEvents]A list of events with which the character is associated, if anyimages: List[CharacterImage]A list of images associated with the character, if anylinks: 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: intReturns the age of the character when they died if the date of death is defined, otherwise returns the current age. This is a virtual@propertyfull_name: strReturns 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.