EighthSponsor¶
Qualified name: intranet.apps.eighth.models.EighthSponsor
- class intranet.apps.eighth.models.EighthSponsor(*args, **kwargs)[source]¶
Bases:
AbstractBaseEighthModel
Represents 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 (
OneToOneField
toUser
) – User (related name:sponsor_obj
)
Reverse relationships:
- Parameters:
eighthactivity (Reverse
ManyToManyField
fromEighthActivity
) – All eighth activities of this eighth sponsor (related name ofsponsors
)eighthscheduledactivity (Reverse
ManyToManyField
fromEighthScheduledActivity
) – All eighth scheduled activities of this eighth sponsor (related name ofsponsors
)
Methods
get_department_display
Shows the label of the
department
.Save model without saving a historical record
Attributes
DEPARTMENTS
Type:
BooleanField
Type:
CharField
eighthactivity_set
Type: Reverse
ManyToManyField
fromEighthActivity
eighthscheduledactivity_set
Type: Reverse
ManyToManyField
fromEighthScheduledActivity
first_name
Type:
CharField
Type:
BooleanField
history
id
Type:
AutoField
Type:
CharField
If show_full_name is set, returns "last name, first name".
objects
Type:
BooleanField
Type:
BooleanField
Returns True if the sponsor's name contains "to be assigned" or similar.
Type:
OneToOneField
toUser
user_id
Internal field, use
user
instead.- 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 model without saving a historical record
Make sure you know what you’re doing before you use this method.