コード例 #1
0
ファイル: home.py プロジェクト: JeffreiToledo/Jeff_Script
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)
コード例 #2
0
ファイル: home.py プロジェクト: luuhfelix/ProjetoFilmes
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)
コード例 #3
0
ファイル: home.py プロジェクト: renzon/fatec-script-2
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)
コード例 #4
0
ファイル: home.py プロジェクト: gamunax/pyhtongamunax
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)
コード例 #5
0
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)
コード例 #6
0
ファイル: rest.py プロジェクト: JeffreiToledo/Jeff_Script
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)
コード例 #7
0
ファイル: rest.py プロジェクト: gamunax/pyhtongamunax
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)
コード例 #8
0
ファイル: rest.py プロジェクト: emillia/Tekton-Master-Emilia
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)