class IntendedCourseTypeProxy(colproxy.BaseProxy):
def save(self, courses, request):
[store.remove(sic) for sic in store.find(StudentIntendedCourse, StudentIntendedCourse.student_id == self.obj.id)]
if courses is not None:
for c in courses:
c = int(c);
sic = StudentIntendedCourse()
sic.student_id = self.obj.id
sic.intended_course_id = c
store.add(sic)
class StudyPlanProxy(colproxy.BaseProxy):
def save(self, courses, request):
[store.remove(ssp) for ssp in store.find(StudentStudyPlan, StudentStudyPlan.student_id == self.obj.id)]
if courses is not None:
for c in courses:
c = int(c);
ssp = StudentStudyPlan()
ssp.student_id = self.obj.id
ssp.course_id = c
store.add(ssp)