Exemplo n.º 1
0
def read_taught_subjects(
        career,
        file_type,
        quarter
):
    data_type = cast.DataType.taught_subjects

    workbook = open_workbook(career, file_type, quarter)
    worksheet = get_worksheet(data_type, file_type, quarter, workbook)

    cells = get_headers_cells(data_type, file_type, quarter)
    rows = read_up_to_empty(worksheet, cells.subject.y + 1, get_columns(cells), cells.subject.x)

    taught_subjects_data = []
    for row in rows:
        tmp = {}

        classroom_degree = cast.cast_string_to_classroom_degree(row[0])
        tmp['classroom_degree'] = model_interface.get_classroom_degree(classroom_degree)

        classroom_identifier = cast.cast_string_to_classroom_identifier(row[1])
        tmp['classroom_identifier'] = model_interface.get_classroom_identifier(classroom_identifier)

        professor_name = cast.cast_string_to_name(row[2])
        tmp['professor'] = model_interface.get_professor(name=professor_name)

        subject_name = cast.cast_string_to_name(row[3])
        tmp['subject'] = model_interface.get_subject(name=subject_name)

        taught_subjects_data.append(tmp)

    return taught_subjects_data
Exemplo n.º 2
0
def register_grades_from_grades_data(
        career,
        data_type,
        grades_data,
        quarter
):
    for entry in grades_data:
        degree = model_interface.get_classroom_degree(entry.degree)
        identifier = model_interface.get_classroom_identifier(entry.identifier)
        classroom = model_interface.get_classroom(career, degree, identifier, quarter)
        student = model_interface.get_student(entry.registration_number)
        subject = model_interface.get_subject(entry.subject)
        taught_subject = model_interface.get_taught_subject(classroom, subject)
        student_in_taught_subject = model_interface.get_student_in_taught_subject(student, taught_subject)

        if data_type == coordination.scripts.populate.old.cast.DataType.first_grade:
            student_in_taught_subject.first_grade = entry.first_grade
        elif data_type == coordination.scripts.populate.old.cast.DataType.second_grade:
            student_in_taught_subject.second_grade = entry.second_grade
        elif data_type == coordination.scripts.populate.old.cast.DataType.regular_grade:
            student_in_taught_subject.regular_grade = entry.regular_grade
        elif data_type == coordination.scripts.populate.old.cast.DataType.final_grade:
            status = model_interface.get_taught_status(entry.status)

            student_in_taught_subject.taught_subject_status = status
            student_in_taught_subject.final_grade = entry.final_grade
        else:
            raise Exception('¡Dato no soportado <{:s}>!'.format(data_type))

        student_in_taught_subject.save()
Exemplo n.º 3
0
def create_group_from_academic_load(
        career,
        degree,
        generation,
        identifier,
        quarter
):

    file_type = coordination.scripts.populate.old.cast.FileType.academic_load

    if degree == model_interface.get_classroom_degree(1):
        students = create_students(career, degree, file_type, generation, identifier, quarter)
    else:
        students = find_students(file_type, quarter)

    classroom = create_classroom(career, degree, file_type, identifier, quarter, None)
    register_students_in_classroom(classroom, students)
Exemplo n.º 4
0
def register_academic_loads_from_file(classroom):
    file_type = coordination.scripts.populate.old.cast.FileType.academic_load

    students_data = coordination.scripts.populate.old.xls_interface.read_students_data(
        classroom.career,
        classroom.degree,
        file_type,
        classroom.identifier,
        classroom.quarter
    )

    for student in classroom.student.all():
        student_data = search_student_in_students_data(students_data, student)
        academic_load_data = coordination.scripts.populate.old.xls_interface.read_student_academic_load_data(
            classroom.career,
            classroom.degree,
            file_type,
            classroom.identifier,
            student_data,
            classroom.quarter
        )

        for entry in academic_load_data:
            degree = model_interface.get_classroom_degree(entry.degree)
            identifier = model_interface.get_classroom_identifier(entry.identifier)

            current_classroom = model_interface.get_classroom(
                career=classroom.career,
                degree=degree,
                identifier=identifier,
                quarter=classroom.quarter
            )

            subject = model_interface.get_subject(entry.subject)
            taught_subject = TaughtSubject.objects.get(
                classroom=current_classroom,
                subject=subject
            )

            opportunity = model_interface.get_subject_opportunity(entry.opportunity)
            StudentInTaughtSubject.objects.create(
                opportunity=opportunity,
                student=student,
                taught_subject=taught_subject
            )
Exemplo n.º 5
0
def main():
    career = model_interface.get_career(code='ISW')
    year = model_interface.get_year(id=2013)
    curricular_map = model_interface.get_curricular_map(career=career,
                                                        year=year)

    spine = model_interface.get_curricular_axis(code='CV')
    speciality = model_interface.get_curricular_axis(code='ES')
    optional = model_interface.get_curricular_axis(code='OP')
    transversal = model_interface.get_curricular_axis(code='TR')

    ####################################################################################################################
    # first
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(1)
    Subject.objects.create(classroom_practical_hours=1,
                           classroom_theoretical_hours=4,
                           code='INGI',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Inglés I',
                           practical_hours=2,
                           theoretical_hours=4)
    Subject.objects.create(classroom_practical_hours=1,
                           classroom_theoretical_hours=2,
                           code='VAS',
                           credits=3,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Valores del ser',
                           practical_hours=1,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=4,
                           classroom_theoretical_hours=2,
                           code='CDI',
                           credits=8,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Cálculo diferencial e integral',
                           practical_hours=6,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=3,
                           code='MAD',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Matemáticas discretas',
                           practical_hours=3,
                           theoretical_hours=3)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=2,
                           code='ELM',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Electricidad y magnetismo',
                           practical_hours=3,
                           theoretical_hours=3)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=3,
                           code='IAP',
                           credits=7,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Introducción a la programación',
                           practical_hours=3,
                           theoretical_hours=4)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=2,
                           code='ADM',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Administración',
                           practical_hours=3,
                           theoretical_hours=3)

    ####################################################################################################################
    # second
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(2)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=2,
                           code='INGII',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Inglés II',
                           practical_hours=5,
                           theoretical_hours=5)
    Subject.objects.create(classroom_practical_hours=1,
                           classroom_theoretical_hours=2,
                           code='INE',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Inteligencia emocional',
                           practical_hours=1,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=2,
                           code='CAV',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Cálculo vectorial',
                           practical_hours=5,
                           theoretical_hours=5)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=2,
                           code='ALL',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Álgebra lineal',
                           practical_hours=5,
                           theoretical_hours=5)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=2,
                           code='SID',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Sistemas digitales',
                           practical_hours=3,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=2,
                           code='POO',
                           credits=7,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Programación orientada a objetos',
                           practical_hours=4,
                           theoretical_hours=3)
    Subject.objects.create(classroom_practical_hours=4,
                           classroom_theoretical_hours=1,
                           code='ESD',
                           credits=7,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Estructuras de datos',
                           practical_hours=6,
                           theoretical_hours=2)

    ####################################################################################################################
    # third
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(3)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=3,
                           code='INGIII',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Inglés III',
                           practical_hours=3,
                           theoretical_hours=3)
    Subject.objects.create(classroom_practical_hours=1,
                           classroom_theoretical_hours=2,
                           code='DEI',
                           credits=3,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Desarrollo interpersonal',
                           practical_hours=1,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=3,
                           code='ECD',
                           credits=8,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Ecuaciones diferenciales',
                           practical_hours=4,
                           theoretical_hours=4)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=3,
                           code='PRE',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Probabilidad y estadística',
                           practical_hours=5,
                           theoretical_hours=6)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=2,
                           code='ARC',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Arquitectura de computadoras',
                           practical_hours=4,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=1,
                           code='POE',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Programación orientada a eventos',
                           practical_hours=5,
                           theoretical_hours=1)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=2,
                           code='BAD',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Bases de datos',
                           practical_hours=4,
                           theoretical_hours=2)

    ####################################################################################################################
    # fourth
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(4)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=3,
                           code='INGIV',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Inglés IV',
                           practical_hours=3,
                           theoretical_hours=3)
    Subject.objects.create(classroom_practical_hours=1,
                           classroom_theoretical_hours=2,
                           code='HAP',
                           credits=3,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Habilidades del pensamiento',
                           practical_hours=1,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=2,
                           code='MEN',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Métodos numéricos',
                           practical_hours=3,
                           theoretical_hours=3)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=2,
                           code='PRW',
                           credits=7,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Programación web',
                           practical_hours=4,
                           theoretical_hours=3)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=1,
                           code='BDD',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Bases de datos distribuidas',
                           practical_hours=4,
                           theoretical_hours=1)
    Subject.objects.create(classroom_practical_hours=1,
                           classroom_theoretical_hours=4,
                           code='INS',
                           credits=7,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Ingeniería de software',
                           practical_hours=2,
                           theoretical_hours=5)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=3,
                           code='FUR',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Fundamentos de redes',
                           practical_hours=3,
                           theoretical_hours=3)

    ####################################################################################################################
    # fifth
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(5)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=3,
                           code='INGV',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Inglés V',
                           practical_hours=3,
                           theoretical_hours=3)
    Subject.objects.create(classroom_practical_hours=1,
                           classroom_theoretical_hours=2,
                           code='HAO',
                           credits=3,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Habilidades organizacionales',
                           practical_hours=1,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=2,
                           code='PRO',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Programación concurrente',
                           practical_hours=3,
                           theoretical_hours=3)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=1,
                           code='EDA',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Estructuras de datos avanzadas',
                           practical_hours=5,
                           theoretical_hours=1)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=2,
                           code='ANS',
                           credits=7,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Análisis de sistemas',
                           practical_hours=4,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=2,
                           code='RED',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Redes',
                           practical_hours=4,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=2,
                           code='SIO',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Sistemas operativos',
                           practical_hours=3,
                           theoretical_hours=3)

    ####################################################################################################################
    # sixth
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(6)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=3,
                           code='INGVI',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Inglés VI',
                           practical_hours=3,
                           theoretical_hours=3)
    Subject.objects.create(classroom_practical_hours=1,
                           classroom_theoretical_hours=2,
                           code='ETP',
                           credits=3,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Ética profesional',
                           practical_hours=1,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=2,
                           code='DSC',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Desarrollo de sistemas cliente/servidor',
                           practical_hours=4,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=2,
                           code='DIS',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Diseño de sistemas',
                           practical_hours=4,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=2,
                           code='SAI',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Seguridad informática',
                           practical_hours=3,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=2,
                           code='LEA',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Lenguajes y autómatas',
                           practical_hours=4,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=0,
                           classroom_theoretical_hours=0,
                           code='ESOFI',
                           credits=8,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Estancia I',
                           practical_hours=8,
                           theoretical_hours=0)

    ####################################################################################################################
    # seventh
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(7)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=3,
                           code='INGVII',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Inglés VII',
                           practical_hours=3,
                           theoretical_hours=3)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=2,
                           code='MAS',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Mantenimiento de sistemas',
                           practical_hours=3,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=2,
                           code='CAS',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Calidad de software',
                           practical_hours=3,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=2,
                           code='COI',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Compiladores e intérpretes',
                           practical_hours=4,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=2,
                           code='INE',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Ingeniería económica',
                           practical_hours=3,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=2,
                           code='VIA',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=optional,
                           degree=degree,
                           name='Visión artificial',
                           practical_hours=3,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=0,
                           classroom_theoretical_hours=0,
                           code='ESOFII',
                           credits=8,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Estancia II',
                           practical_hours=8,
                           theoretical_hours=0)

    ####################################################################################################################
    # eighth
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(8)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=3,
                           code='INGVIII',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Inglés VIII',
                           practical_hours=3,
                           theoretical_hours=3)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=2,
                           code='DAM',
                           credits=7,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Desarrollo de aplicaciones móviles',
                           practical_hours=4,
                           theoretical_hours=3)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=2,
                           code='REI',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Reingeniería',
                           practical_hours=3,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=3,
                           code='PPS',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Planeación de proyectos de software',
                           practical_hours=3,
                           theoretical_hours=3)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=2,
                           code='INA',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Inteligencia artificial',
                           practical_hours=3,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=2,
                           code='GRM',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Graficación y multimedia',
                           practical_hours=4,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=2,
                           code='REV',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=optional,
                           degree=degree,
                           name='Realidad virtual',
                           practical_hours=3,
                           theoretical_hours=2)

    ####################################################################################################################
    # ninth
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(9)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=3,
                           code='INGIX',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Inglés IX',
                           practical_hours=3,
                           theoretical_hours=3)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=2,
                           code='SII',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Sistemas de información',
                           practical_hours=3,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=3,
                           code='APS',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=spine,
                           degree=degree,
                           name='Administración de proyectos de software',
                           practical_hours=3,
                           theoretical_hours=3)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=2,
                           code='DSI',
                           credits=6,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Desarrollo de sistemas inteligentes',
                           practical_hours=4,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=1,
                           classroom_theoretical_hours=3,
                           code='ADT',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Administración de TIC',
                           practical_hours=2,
                           theoretical_hours=3)
    Subject.objects.create(classroom_practical_hours=2,
                           classroom_theoretical_hours=2,
                           code='DAM',
                           credits=5,
                           curricular_map=curricular_map,
                           curricular_axis=optional,
                           degree=degree,
                           name='Desarrollo de aplicaciones móviles avanzadas',
                           practical_hours=3,
                           theoretical_hours=2)
    Subject.objects.create(classroom_practical_hours=3,
                           classroom_theoretical_hours=2,
                           code='AOS',
                           credits=7,
                           curricular_map=curricular_map,
                           curricular_axis=speciality,
                           degree=degree,
                           name='Arquitecturas orientadas a servicios',
                           practical_hours=4,
                           theoretical_hours=3)

    ####################################################################################################################
    # tenth
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(10)
    Subject.objects.create(classroom_practical_hours=0,
                           classroom_theoretical_hours=0,
                           code='ESOFIII',
                           credits=40,
                           curricular_map=curricular_map,
                           curricular_axis=transversal,
                           degree=degree,
                           name='Estadía',
                           practical_hours=40,
                           theoretical_hours=0)
Exemplo n.º 6
0
def main():
    career = model_interface.get_career(code='ISW')
    year = model_interface.get_year(id=2013)
    curricular_map = model_interface.get_curricular_map(
        career=career,
        year=year
    )

    spine = model_interface.get_curricular_axis(code='CV')
    speciality = model_interface.get_curricular_axis(code='ES')
    optional = model_interface.get_curricular_axis(code='OP')
    transversal = model_interface.get_curricular_axis(code='TR')

    ####################################################################################################################
    # first
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(1)
    Subject.objects.create(
        classroom_practical_hours=1,
        classroom_theoretical_hours=4,
        code='INGI',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Inglés I',
        practical_hours=2,
        theoretical_hours=4
    )
    Subject.objects.create(
        classroom_practical_hours=1,
        classroom_theoretical_hours=2,
        code='VAS',
        credits=3,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Valores del ser',
        practical_hours=1,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=4,
        classroom_theoretical_hours=2,
        code='CDI',
        credits=8,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Cálculo diferencial e integral',
        practical_hours=6,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=3,
        code='MAD',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Matemáticas discretas',
        practical_hours=3,
        theoretical_hours=3
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=2,
        code='ELM',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Electricidad y magnetismo',
        practical_hours=3,
        theoretical_hours=3
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=3,
        code='IAP',
        credits=7,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Introducción a la programación',
        practical_hours=3,
        theoretical_hours=4
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=2,
        code='ADM',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Administración',
        practical_hours=3,
        theoretical_hours=3
    )

    ####################################################################################################################
    # second
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(2)
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=2,
        code='INGII',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Inglés II',
        practical_hours=5,
        theoretical_hours=5
    )
    Subject.objects.create(
        classroom_practical_hours=1,
        classroom_theoretical_hours=2,
        code='INE',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Inteligencia emocional',
        practical_hours=1,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=2,
        code='CAV',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Cálculo vectorial',
        practical_hours=5,
        theoretical_hours=5
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=2,
        code='ALL',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Álgebra lineal',
        practical_hours=5,
        theoretical_hours=5
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=2,
        code='SID',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Sistemas digitales',
        practical_hours=3,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=3,
            classroom_theoretical_hours=2,
            code='POO',
            credits=7,
            curricular_map=curricular_map,
            curricular_axis=spine,
            degree=degree,
            name='Programación orientada a objetos',
            practical_hours=4,
            theoretical_hours=3
    )
    Subject.objects.create(
        classroom_practical_hours=4,
        classroom_theoretical_hours=1,
        code='ESD',
        credits=7,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Estructuras de datos',
        practical_hours=6,
        theoretical_hours=2
    )

    ####################################################################################################################
    # third
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(3)
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=3,
        code='INGIII',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Inglés III',
        practical_hours=3,
        theoretical_hours=3
    )
    Subject.objects.create(
        classroom_practical_hours=1,
        classroom_theoretical_hours=2,
        code='DEI',
        credits=3,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Desarrollo interpersonal',
        practical_hours=1,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=3,
        code='ECD',
        credits=8,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Ecuaciones diferenciales',
        practical_hours=4,
        theoretical_hours=4
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=3,
        code='PRE',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Probabilidad y estadística',
        practical_hours=5,
        theoretical_hours=6
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=2,
        code='ARC',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Arquitectura de computadoras',
        practical_hours=4,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=1,
        code='POE',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Programación orientada a eventos',
        practical_hours=5,
        theoretical_hours=1
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=2,
        code='BAD',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Bases de datos',
        practical_hours=4,
        theoretical_hours=2
    )

    ####################################################################################################################
    # fourth
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(4)
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=3,
        code='INGIV',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Inglés IV',
        practical_hours=3,
        theoretical_hours=3
    )
    Subject.objects.create(
        classroom_practical_hours=1,
        classroom_theoretical_hours=2,
        code='HAP',
        credits=3,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Habilidades del pensamiento',
        practical_hours=1,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=2,
        code='MEN',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Métodos numéricos',
        practical_hours=3,
        theoretical_hours=3
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=2,
        code='PRW',
        credits=7,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Programación web',
        practical_hours=4,
        theoretical_hours=3
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=1,
        code='BDD',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Bases de datos distribuidas',
        practical_hours=4,
        theoretical_hours=1
    )
    Subject.objects.create(
        classroom_practical_hours=1,
        classroom_theoretical_hours=4,
        code='INS',
        credits=7,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Ingeniería de software',
        practical_hours=2,
        theoretical_hours=5
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=3,
        code='FUR',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Fundamentos de redes',
        practical_hours=3,
        theoretical_hours=3
    )

    ####################################################################################################################
    # fifth
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(5)
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=3,
        code='INGV',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Inglés V',
        practical_hours=3,
        theoretical_hours=3
    )
    Subject.objects.create(
        classroom_practical_hours=1,
        classroom_theoretical_hours=2,
        code='HAO',
        credits=3,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Habilidades organizacionales',
        practical_hours=1,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=2,
        code='PRO',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Programación concurrente',
        practical_hours=3,
        theoretical_hours=3
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=1,
        code='EDA',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Estructuras de datos avanzadas',
        practical_hours=5,
        theoretical_hours=1
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=2,
        code='ANS',
        credits=7,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Análisis de sistemas',
        practical_hours=4,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=2,
        code='RED',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Redes',
        practical_hours=4,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=2,
        code='SIO',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Sistemas operativos',
        practical_hours=3,
        theoretical_hours=3
    )

    ####################################################################################################################
    # sixth
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(6)
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=3,
        code='INGVI',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Inglés VI',
        practical_hours=3,
        theoretical_hours=3
    )
    Subject.objects.create(
        classroom_practical_hours=1,
        classroom_theoretical_hours=2,
        code='ETP',
        credits=3,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Ética profesional',
        practical_hours=1,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=2,
        code='DSC',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Desarrollo de sistemas cliente/servidor',
        practical_hours=4,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=2,
        code='DIS',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Diseño de sistemas',
        practical_hours=4,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=2,
        code='SAI',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Seguridad informática',
        practical_hours=3,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=2,
        code='LEA',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Lenguajes y autómatas',
        practical_hours=4,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=0,
        classroom_theoretical_hours=0,code='ESOFI',
        credits=8,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Estancia I',
        practical_hours=8,
        theoretical_hours=0
    )

    ####################################################################################################################
    # seventh
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(7)
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=3,
        code='INGVII',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Inglés VII',
        practical_hours=3,
        theoretical_hours=3
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=2,
        code='MAS',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Mantenimiento de sistemas',
        practical_hours=3,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=2,
        code='CAS',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Calidad de software',
        practical_hours=3,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=2,
        code='COI',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Compiladores e intérpretes',
        practical_hours=4,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=2,
        code='INE',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Ingeniería económica',
        practical_hours=3,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=2,
        code='VIA',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=optional,
        degree=degree,
        name='Visión artificial',
        practical_hours=3,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=0,
        classroom_theoretical_hours=0,
        code='ESOFII',
        credits=8,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Estancia II',
        practical_hours=8,
        theoretical_hours=0
    )

    ####################################################################################################################
    # eighth
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(8)
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=3,
        code='INGVIII',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Inglés VIII',
        practical_hours=3,
        theoretical_hours=3
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=2,
        code='DAM',
        credits=7,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Desarrollo de aplicaciones móviles',
        practical_hours=4,
        theoretical_hours=3
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=2,
        code='REI',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Reingeniería',
        practical_hours=3,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=3,
        code='PPS',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Planeación de proyectos de software',
        practical_hours=3,
        theoretical_hours=3
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=2,
        code='INA',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Inteligencia artificial',
        practical_hours=3,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=2,
        code='GRM',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Graficación y multimedia',
        practical_hours=4,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=2,
        code='REV',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=optional,
        degree=degree,
        name='Realidad virtual',
        practical_hours=3,
        theoretical_hours=2
    )

    ####################################################################################################################
    # ninth
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(9)
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=3,
        code='INGIX',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Inglés IX',
        practical_hours=3,
        theoretical_hours=3
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=2,
        code='SII',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Sistemas de información',
        practical_hours=3,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=3,
        code='APS',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=spine,
        degree=degree,
        name='Administración de proyectos de software',
        practical_hours=3,
        theoretical_hours=3
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=2,
        code='DSI',
        credits=6,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Desarrollo de sistemas inteligentes',
        practical_hours=4,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=1,
        classroom_theoretical_hours=3,
        code='ADT',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Administración de TIC',
        practical_hours=2,
        theoretical_hours=3
    )
    Subject.objects.create(
        classroom_practical_hours=2,
        classroom_theoretical_hours=2,
        code='DAM',
        credits=5,
        curricular_map=curricular_map,
        curricular_axis=optional,
        degree=degree,
        name='Desarrollo de aplicaciones móviles avanzadas',
        practical_hours=3,
        theoretical_hours=2
    )
    Subject.objects.create(
        classroom_practical_hours=3,
        classroom_theoretical_hours=2,
        code='AOS',
        credits=7,
        curricular_map=curricular_map,
        curricular_axis=speciality,
        degree=degree,
        name='Arquitecturas orientadas a servicios',
        practical_hours=4,
        theoretical_hours=3
    )

    ####################################################################################################################
    # tenth
    ####################################################################################################################
    degree = model_interface.get_classroom_degree(10)
    Subject.objects.create(
        classroom_practical_hours=0,
        classroom_theoretical_hours=0,
        code='ESOFIII',
        credits=40,
        curricular_map=curricular_map,
        curricular_axis=transversal,
        degree=degree,
        name='Estadía',
        practical_hours=40,
        theoretical_hours=0
    )