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 IDuser_id: int
The ID of the User who created the character entry in the databasetitle: str
The character's title, if anyhonorific: str
The character's preferred honorific, such as Mr., Mrs., or Ms., for examplefirst_name: str
The character's first namemiddle_name: str
The character's middle name(s), if anylast_name: str
The character's last name, if anynickname: str
The character's nickname, if anygender: str
The character's gender, if specifiedsex: str
The character's sex, if specifiedethnicity: str
The character's ethnicity, if specifiedrace: str
The character's race, if specifiedtribe_or_clan: str
The character's tribe or clan, if specifiednationality: str
The character's nationality, if specifiedreligion: str
The character's religion, if specifiedoccupation: str
The character's occupation, if specifiededucation: str
The character's education, if specifiedmarital_status: str
The character's marital status, if specifiedchildren: bool
Whether or not the character has any childrendate_of_birth: str
The character's date of birth in the format yyyy-mm-dd, if specifieddate_of_death: str
The character's date of death in the format yyyy-mm-dd, if specifieddescription: str
A description of the charactermbti: str
The character's Myers-Briggs Type Indicator, if specifiedenneagram: str
The character's Enneagram Type, if specifiedwounds: str
The conditions or events of the character's life that is the cause of emotional paincreated: str
This is actually a Python Datetime object except for input and outputmodified: 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 theusers
table 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: 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.