EighthRoom¶
Qualified name: intranet.apps.eighth.models.EighthRoom
- class intranet.apps.eighth.models.EighthRoom(*args, **kwargs)[source]¶
Bases:
AbstractBaseEighthModel
Represents a room in which an eighth period activity can be held. .. attribute:: name
The name of the room.
- type:
str
- capacity¶
The maximum capacity of the room (-1 for unlimited, 0 to prevent student signup)
- Type:
- Parameters:
id (AutoField) – Primary key: ID
created_time (DateTimeField) – Created time
last_modified_time (DateTimeField) – Last modified time
name (CharField) – Name
capacity (SmallIntegerField) – Capacity
available_for_eighth (BooleanField) – Available for eighth
Reverse relationships:
- Parameters:
eighthactivity (Reverse
ManyToManyField
fromEighthActivity
) – All eighth activities of this eighth room (related name ofrooms
)eighthscheduledactivity (Reverse
ManyToManyField
fromEighthScheduledActivity
) – All eighth scheduled activities of this eighth room (related name ofrooms
)
Methods
Save model without saving a historical record
Returns the total capacity of the provided rooms.
Attributes
Type:
BooleanField
Type:
SmallIntegerField
eighthactivity_set
Type: Reverse
ManyToManyField
fromEighthActivity
eighthscheduledactivity_set
Type: Reverse
ManyToManyField
fromEighthScheduledActivity
The formatted name of the room.
history
id
Type:
AutoField
name
Type:
CharField
objects
Whether the Room needs to be assigned.
unique_together
- property formatted_name: str¶
The formatted name of the room. If it looks like the room is a numbered room – the name starts with either a number or with the text “Room” – returns “Rm. <room number>.” :returns: The formatted name of the Room.
- 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.
- static total_capacity_of_rooms(rooms: Iterable[EighthRoom]) int [source]¶
Returns the total capacity of the provided rooms. :param rooms: Rooms to determine total capacity for.
- Returns:
The total capacity of the provided rooms.