EighthRoom¶
Qualified name: intranet.apps.eighth.models.EighthRoom
- class intranet.apps.eighth.models.EighthRoom(*args, **kwargs)[source]¶
Bases:
AbstractBaseEighthModelRepresents 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
ManyToManyFieldfromEighthActivity) – All eighth activities of this eighth room (related name ofrooms)eighthscheduledactivity (Reverse
ManyToManyFieldfromEighthScheduledActivity) – All eighth scheduled activities of this eighth room (related name ofrooms)
Methods
Save the model instance without creating a historical record.
Returns the total capacity of the provided rooms.
Attributes
Type:
BooleanFieldType:
SmallIntegerFieldcreated_timeType:
DateTimeFieldeighthactivity_setType: Reverse
ManyToManyFieldfromEighthActivityeighthscheduledactivity_setType: Reverse
ManyToManyFieldfromEighthScheduledActivityThe formatted name of the room.
historyidType:
AutoFieldlast_modified_timeType:
DateTimeFieldnameType:
CharFieldobjectsWhether 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 the model instance without creating a historical record.
Make sure you know what you’re doing before using 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.