Serves Demo Scene 7: mc.timetable.slot (batch, weekday, period,
subject, teacher, room, year, term) is the single dataset. "Three
read views" are three entry points into that same model rather than
three separate data structures - a stat button on mc.batch, on
mc.teacher, and on mc.student (resolved through the student's active
enrollment to their batch) each open the same list/search action with
a different domain. Auto-generation is out of scope per spec; this
module only configures slots by hand (demo data is a real Mon-Fri
week for Grade 8-A, since a timetable is a recurring weekly pattern
and one week fully represents it, unlike attendance/fees which
genuinely need a run of history).
Conflict prevention ("a teacher or a room cannot hold two slots in
the same weekday+period") follows the same two-layer pattern used for
mc.academic.year.is_current and mc.enrollment in O1: a partial unique
index per conflict type (teacher, room, and - not explicitly asked
for but an obvious extension of the same rule - batch, since a batch
can't be in two places at once either) is the actual guarantee, and a
pre-check in create()/write() raises a readable ValidationError
before the insert/update, not after, for the same reason established
building mc.enrollment: the DB index fires first and the friendly
message is unreachable otherwise.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
604 B
604 B
| 1 | id | name | model_id:id | group_id:id | perm_read | perm_write | perm_create | perm_unlink |
|---|---|---|---|---|---|---|---|---|
| 2 | access_mc_timetable_slot_administrator | mc.timetable.slot.administrator | model_mc_timetable_slot | mc_education_base.group_school_administrator | 1 | 1 | 1 | 1 |
| 3 | access_mc_timetable_slot_staff | mc.timetable.slot.staff | model_mc_timetable_slot | mc_education_base.group_school_staff | 1 | 1 | 1 | 1 |
| 4 | access_mc_timetable_slot_teacher | mc.timetable.slot.teacher | model_mc_timetable_slot | mc_education_base.group_teacher | 1 | 0 | 0 | 0 |
| 5 | access_mc_timetable_slot_accountant | mc.timetable.slot.accountant | model_mc_timetable_slot | mc_education_base.group_accountant | 1 | 0 | 0 | 0 |