Example #1
0
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
Example #2
0
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
Example #3
0
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
Example #4
0
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