Ejemplo n.º 1
0
def _update_learning_unit_year(luy_to_update, fields_to_update, with_report,
                               entities_to_update_by_type):
    fields_to_exclude = ()
    if with_report:
        fields_to_exclude = FIELDS_TO_EXCLUDE_WITH_REPORT

    update_instance_model_from_data(luy_to_update.learning_unit,
                                    fields_to_update,
                                    exclude=('acronym', ))

    luy_to_update.learning_container_year.set_entities(
        entities_to_update_by_type)

    # Only the subtype FULL can edit the container
    if luy_to_update.subtype == learning_unit_year_subtypes.FULL:
        update_instance_model_from_data(luy_to_update.learning_container_year,
                                        fields_to_update,
                                        exclude=fields_to_exclude)
        acronym_full = fields_to_update.get("acronym")
        if acronym_full:
            update_partim_acronym(acronym_full, luy_to_update)
    update_instance_model_from_data(luy_to_update,
                                    fields_to_update,
                                    exclude=fields_to_exclude +
                                    ("in_charge", ))
Ejemplo n.º 2
0
def _update_learning_unit_year(luy_to_update,
                               fields_to_update,
                               fields_to_exclude=()):
    update_instance_model_from_data(luy_to_update.learning_unit,
                                    fields_to_update)
    update_instance_model_from_data(luy_to_update.learning_container_year,
                                    fields_to_update,
                                    exclude=fields_to_exclude)
    update_instance_model_from_data(luy_to_update,
                                    fields_to_update,
                                    exclude=fields_to_exclude)
Ejemplo n.º 3
0
def _update_learning_unit_year(luy_to_update, fields_to_update, with_report):
    fields_to_exclude = ()
    if with_report:
        fields_to_exclude = FIELDS_TO_EXCLUDE_WITH_REPORT

    update_instance_model_from_data(luy_to_update.learning_unit,
                                    fields_to_update)
    update_instance_model_from_data(luy_to_update.learning_container_year,
                                    fields_to_update,
                                    exclude=fields_to_exclude)
    update_instance_model_from_data(luy_to_update,
                                    fields_to_update,
                                    exclude=fields_to_exclude)
Ejemplo n.º 4
0
def _update_learning_unit_year(luy_to_update, fields_to_update, with_report):
    fields_to_exclude = ()
    if with_report:
        fields_to_exclude = FIELDS_TO_EXCLUDE_WITH_REPORT

    update_instance_model_from_data(luy_to_update.learning_unit, fields_to_update, exclude=('acronym',))

    # Only the subtype FULL can edit the container
    if luy_to_update.subtype == learning_unit_year_subtypes.FULL:
        update_instance_model_from_data(luy_to_update.learning_container_year, fields_to_update,
                                        exclude=fields_to_exclude)

    update_instance_model_from_data(luy_to_update, fields_to_update,
                                    exclude=fields_to_exclude + ("in_charge",))
Ejemplo n.º 5
0
def _update_learning_unit_year(luy_to_update, fields_to_update, with_report):
    fields_to_exclude = ()
    if with_report:
        fields_to_exclude = FIELDS_TO_EXCLUDE_WITH_REPORT

    update_instance_model_from_data(luy_to_update.learning_unit,
                                    fields_to_update,
                                    exclude=('acronym', ))

    # Only the subtype FULL can edit the container
    if luy_to_update.subtype == learning_unit_year_subtypes.FULL:
        update_instance_model_from_data(luy_to_update.learning_container_year,
                                        fields_to_update,
                                        exclude=fields_to_exclude)

    update_instance_model_from_data(luy_to_update,
                                    fields_to_update,
                                    exclude=fields_to_exclude +
                                    ("in_charge", ))