def has_schedule(selected_courses, section_constraint=None): schedules = _compute_schedules(selected_courses, free_sections_only=False, generator=True, section_constraint=section_constraint) for schedule in schedules: return True return False
def has_schedule(selected_courses, section_constraint=None): schedules = _compute_schedules( selected_courses, free_sections_only=False, generator=True, section_constraint=section_constraint) for schedule in schedules: return True return False
def compute_schedules(selected_courses, section_constraint=None): """Returns the schedules in a JSON-friendly format. Returns a list of dictionary of course id to crns. """ schedules = _compute_schedules(selected_courses, free_sections_only=False,) #section_constraint=section_constraint) results = [] for schedule in schedules: s = {} for course, section in schedule.items(): s[str(course.id)] = section.id results.append(s) return results
def compute_schedules(selected_courses, section_constraint=None): """Returns the schedules in a JSON-friendly format. Returns a list of dictionary of course id to crns. """ schedules = _compute_schedules( selected_courses, free_sections_only=False ) results = [] for schedule in schedules: s = {} for course, section in schedule.items(): s[str(course.id)] = section.id results.append(s) return results