def index(): cmd = facade.list_courses_cmd() courses = cmd() public_form = facade.course_public_form() course_public_dcts = [public_form.fill_with_model(course) for course in courses] context = {"courses": course_public_dcts, "admin_path": router.to_path(admin)} return TemplateResponse(context)
def index(): cmd = facade.list_courses_cmd() courses = cmd() public_form = facade.course_public_form() course_public_dcts = [public_form.fill_with_model(course) for course in courses] context = {'trailers': course_public_dcts,'admin_path':router.to_path(admin)} return TemplateResponse(context)
def index(): form=FormGenerico() error=form.validate() logging.error(error) cmd = facade.list_courses_cmd() courses = cmd() public_form = facade.course_public_form() course_public_dcts = [public_form.fill_with_model(course) for course in courses] context = {'courses': course_public_dcts,'admin_path':router.to_path(admin)} return TemplateResponse(context)
def index(): cmd = facade.list_courses_cmd() courses = cmd() form_edit_path = router.to_path(form.edit) delete_path = router.to_path(delete) def short_course_dict(course): course_dct = facade.short_course_dct(course) course_dct['edit_path'] = '/'.join([form_edit_path, course_dct['id']]) course_dct['delete_path'] = '/'.join([delete_path, course_dct['id']]) return course_dct short_courses = [short_course_dict(course) for course in courses] context = {'courses': short_courses, 'course_form': router.to_path(form)} return TemplateResponse(context)
def index(): cmd = facade.list_courses_cmd() courses = cmd() edit_path = router.to_path(edit) delete_path = router.to_path(delete) short_form = facade.course_short_form() def short_course_dict(course): course_dct = short_form.fill_with_model(course) course_dct['edit_path'] = router.to_path(edit_path, course_dct['id']) course_dct['delete_path'] = router.to_path(delete_path, course_dct['id']) return course_dct short_courses = [short_course_dict(course) for course in courses] context = {'courses': short_courses, 'new_path': router.to_path(new)} return TemplateResponse(context)
def index(): cmd = facade.list_courses_cmd() course_list = cmd() short_form=facade.course_short_form() course_short = [short_form.fill_with_model(m) for m in course_list] return JsonResponse(course_short)
def index(): cmd = facade.list_courses_cmd() course_list = cmd() course_short = [facade.short_course_dct(n) for n in course_list] return JsonResponse(course_short)
def index(): cmd = facade.list_courses_cmd() course_list = cmd() short_form = facade.course_short_form() course_short = [short_form.fill_with_model(m) for m in course_list] return JsonResponse(course_short)