classrooms Classroom Management¶
Author: Zhenyu Yang yangzhenyu@sust.edu.cn
Last updated: Apr 24, 2026
Corresponding API docs: Classroom Management API
classrooms Code Entry¶
backend/apps/classrooms/models/__init__.pybackend/apps/classrooms/views/__init__.pybackend/apps/classrooms/services/__init__.py
classrooms Core Data¶
Classroom¶
Unique key:
building + room_numberKey fields:
capacityequipmentstatuslast_maintenanceremark
Read Operations¶
list,retrieve,free, andscheduleall require authentication.The list supports filtering by
building,capacity_min, andstatus.List sorting prioritizes classrooms with missing or unreasonable capacity values, helping operations staff identify records that need data cleanup.
classrooms Permission Boundaries¶
Create classroom:
superadminonly.Update / partial update:
superadminorsecretary.Delete classroom:
superadminonly.Excel import:
superadmin/secretary/assistant.
Key Business Rules¶
Free Classrooms (free)¶
Excludes two types of conflicts simultaneously:
Manual reservations:
status in (pending, approved)andsource_type=manualCourse occupancy: computed via
courses.services.get_conflicting_classrooms()
Classroom Schedule (schedule)¶
The time range is expanded to full days.
Two types of occupancy are merged:
Manual reservations
Course instances (
CourseOccurrence)
Idle time blocks are padded so the frontend can directly render the timeline.
In the current implementation,
pendingmanual reservations are also treated as occupied blocks.
Import¶
Entry:
ClassroomViewSet.import_classroomsFile requirements:
.xlsx/.xls, max 50MB.Import logic lives in
ClassroomImportService.Supports both creation and update; errors are aggregated and returned.
classrooms and Other Modules¶
borrowings,repairs, andabusereference classrooms via foreign keys.coursesuses classrooms to host course instances.signagebinds one-to-one with a classroom viaSignageDevice.