EighthSponsor¶
Qualified name: intranet.apps.eighth.models.EighthSponsor
- class intranet.apps.eighth.models.EighthSponsor(*args, **kwargs)[source]¶
Bases:
AbstractBaseEighthModelRepresents a sponsor for an eighth period activity. A sponsor could be linked to an actual user or just a name. .. attribute:: first_name
The first name of the sponsor.
- type:
str
- show_full_name¶
Whether to always show the sponsor’s full name (e.x. because there are two teachers named Lewis).
- Type:
- Parameters:
id (AutoField) – Primary key: ID
created_time (DateTimeField) – Created time
last_modified_time (DateTimeField) – Last modified time
first_name (CharField) – First name
last_name (CharField) – Last name
department (CharField) – Department
full_time (BooleanField) – Full time
online_attendance (BooleanField) – Online attendance
contracted_eighth (BooleanField) – Contracted eighth
show_full_name (BooleanField) – Show full name
Relationship fields:
- Parameters:
user (
OneToOneFieldtoUser) – User (related name:sponsor_obj)
Reverse relationships:
- Parameters:
eighthactivity (Reverse
ManyToManyFieldfromEighthActivity) – All eighth activities of this eighth sponsor (related name ofsponsors)eighthscheduledactivity (Reverse
ManyToManyFieldfromEighthScheduledActivity) – All eighth scheduled activities of this eighth sponsor (related name ofsponsors)
Methods
get_department_displayShows the label of the
department.Save the model instance without creating a historical record.
Attributes
DEPARTMENTSType:
BooleanFieldcreated_timeType:
DateTimeFieldType:
CharFieldeighthactivity_setType: Reverse
ManyToManyFieldfromEighthActivityeighthscheduledactivity_setType: Reverse
ManyToManyFieldfromEighthScheduledActivityfirst_nameType:
CharFieldType:
BooleanFieldhistoryidType:
AutoFieldlast_modified_timeType:
DateTimeFieldType:
CharFieldIf show_full_name is set, returns "last name, first name".
objectsType:
BooleanFieldType:
BooleanFieldReturns True if the sponsor's name contains "to be assigned" or similar.
Type:
OneToOneFieldtoUseruser_idInternal field, use
userinstead.- property name: str¶
If show_full_name is set, returns “last name, first name”. Otherwise, returns last name only. :returns: The name to display for the sponsor, omitting the first name unless explicitly requested.
- save_without_historical_record(*args, **kwargs)¶
Save the model instance without creating a historical record.
Make sure you know what you’re doing before using this method.