def scores_responsible_search(request): entities_manager = mdl_base.entity_manager.find_by_user(request.user) academic_year = mdl_base.academic_year.current_academic_year() _append_entity_version(entities_manager, academic_year) if request.GET: entities_with_descendants = find_entities_with_descendants_from_entity_managers( entities_manager) attributions = list( mdl_attr.attribution.search_scores_responsible( learning_unit_title=request.GET.get('learning_unit_title'), course_code=request.GET.get('course_code'), entities=entities_with_descendants, tutor=request.GET.get('tutor'), responsible=request.GET.get('scores_responsible'))) dict_attribution = get_attributions_list(attributions, "-score_responsible") return render( request, 'scores_responsible.html', { "entities_manager": entities_manager, "academic_year": academic_year, "dict_attribution": dict_attribution, "learning_unit_title": request.GET.get('learning_unit_title'), "course_code": request.GET.get('course_code'), "tutor": request.GET.get('tutor'), "scores_responsible": request.GET.get('scores_responsible'), "init": "1" }) else: return render( request, 'scores_responsible.html', { "entities_manager": entities_manager, "academic_year": academic_year, "init": "0" })
def scores_responsible(request): entities_manager = mdl_base.entity_manager.find_by_user(request.user) academic_year = mdl_base.academic_year.current_academic_year() _append_entity_version(entities_manager, academic_year) return render(request, 'scores_responsible.html', {"entities_manager": entities_manager, "academic_year": academic_year, "init": "0"})
def scores_responsible_search(request): entities_manager = mdl_base.entity_manager.find_by_user(request.user) academic_year = mdl_base.academic_year.current_academic_year() _append_entity_version(entities_manager, academic_year) if request.GET: entities_with_descendants = find_entities_with_descendants_from_entity_managers(entities_manager) attributions = list(mdl_attr.attribution.search_scores_responsible( learning_unit_title=request.GET.get('learning_unit_title'), course_code=request.GET.get('course_code'), entities=entities_with_descendants, tutor=request.GET.get('tutor'), responsible=request.GET.get('scores_responsible') )) dict_attribution = get_attributions_list(attributions, "-score_responsible") return render(request, 'scores_responsible.html', {"entities_manager": entities_manager, "academic_year": academic_year, "dict_attribution": dict_attribution, "learning_unit_title": request.GET.get( 'learning_unit_title'), "course_code": request.GET.get('course_code'), "tutor": request.GET.get('tutor'), "scores_responsible": request.GET.get('scores_responsible'), "init": "1"}) else: return render(request, 'scores_responsible.html', {"entities_manager": entities_manager, "academic_year": academic_year, "init": "0"})
def search(request): entities_manager = mdl_base.entity_manager.find_by_user(request.user) # The academic year for summary responsible is the next of current academic year academic_year = mdl_base.academic_year.current_academic_year().next() _append_entity_version(entities_manager, academic_year) context = {"entities_manager": entities_manager, "academic_year": academic_year, "init": "0"} if request.GET: tutor = request.GET.get('tutor') summary_responsible = request.GET.get('summary_responsible') course_code = request.GET.get('course_code') learning_unit_title = request.GET.get('learning_unit_title') attributions = search_attributions( entities_manager=entities_manager, tutor=tutor, summary_responsible=summary_responsible, course_code=course_code, learning_unit_title=learning_unit_title, academic_year=academic_year, ) context.update({ "dict_attribution": get_attributions_list(attributions, "-summary_responsible"), "learning_unit_title": learning_unit_title, "course_code": course_code, "tutor": tutor, "summary_responsible": summary_responsible, "init": "1" }) return render(request, 'summary_responsible.html', context)
def scores_responsible(request): entities_manager = mdl_base.entity_manager.find_by_user(request.user) academic_year = mdl_base.academic_year.current_academic_year() _append_entity_version(entities_manager, academic_year) return render(request, 'scores_responsible.html', {"entities_manager": entities_manager, "academic_year": academic_year, "init": "0"})