csmberkeley / csm_web

Web applications for CS Mentors.
https://scheduler.csmentors.org/
MIT License
15 stars 10 forks source link

Allow multiple mentors to teach a single section #464

Open smartspot2 opened 9 months ago

smartspot2 commented 9 months ago

In some special cases, more than one mentor may be assigned to a single section. This is currently disallowed by the database models, as the Section object has a one-to-one (or none) relationship between Mentor objects.

Changing this to a many-to-one relationship (through a foreign key on Mentor to Section) could allow for this feature. However, there are currently many assumptions in the view functions relying on the fact that any given section will only have one mentor. This means that a lot of this logic would need to be rewritten and checked to ensure that nothing breaks as a result of this change.

Changing the section.mentor to a section.mentor_set would also make fetching the course associated with the section a lot harder (since we'd need to fetch the mentor set and get an arbitrary mentor prior to getting the course field). This means that some additional consideration must be made regarding these relationships.