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

last_name

The last name of the sponsor.

Type:

str

user

A users.User object linked to the sponsor.

Type:

User

department

The sponsor’s department.

Type:

str

full_time

Whether the sponsor is full-time.

Type:

bool

online_attendance

Whether the sponsor takes. attendance online.

Type:

bool

contracted_eighth

Whether the sponsor is contracted to supervise 8th periods.

Type:

bool

show_full_name

Whether to always show the sponsor’s full name (e.x. because there are two teachers named Lewis).

Type:

bool

Parameters:

Relationship fields:

Parameters:

user (OneToOneField to User) – User (related name: sponsor_obj)

Reverse relationships:

Parameters:

Methods

get_department_display

Shows the label of the department.

save_without_historical_record

Save model without saving a historical record

Attributes

DEPARTMENTS

contracted_eighth

Type: BooleanField

department

Type: CharField

eighthactivity_set

Type: Reverse ManyToManyField from EighthActivity

eighthscheduledactivity_set

Type: Reverse ManyToManyField from EighthScheduledActivity

first_name

Type: CharField

full_time

Type: BooleanField

history

id

Type: AutoField

last_name

Type: CharField

name

If show_full_name is set, returns "last name, first name".

objects

online_attendance

Type: BooleanField

show_full_name

Type: BooleanField

to_be_assigned

Returns True if the sponsor's name contains "to be assigned" or similar.

user

Type: OneToOneField to User

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.

property to_be_assigned: bool

Returns True if the sponsor’s name contains “to be assigned” or similar. :returns: Whether the sponsor is a “to be assigned” sponsor.