Esempio n. 1
0
def index():
    cmd = facade.list_autoajudas_cmd()
    autoajudas = cmd()
    public_form = facade.autoajuda_public_form()
    autoajuda_public_dcts = [public_form.fill_with_model(autoajuda) for autoajuda in autoajudas]
    context = {'autoajudas': autoajuda_public_dcts,'admin_path':router.to_path(admin)}
    return TemplateResponse(context)
Esempio n. 2
0
def index():
    cmd = facade.list_autoajudas_cmd()
    autoajudas = cmd()
    edit_path = router.to_path(edit)
    delete_path = router.to_path(delete)
    short_form = facade.autoajuda_short_form()

    def short_autoajuda_dict(autoajuda):
        autoajuda_dct = short_form.fill_with_model(autoajuda)
        autoajuda_dct['edit_path'] = router.to_path(edit_path, autoajuda_dct['id'])
        autoajuda_dct['delete_path'] = router.to_path(delete_path, autoajuda_dct['id'])
        return autoajuda_dct

    short_autoajudas = [short_autoajuda_dict(autoajuda) for autoajuda in autoajudas]
    context = {'autoajudas': short_autoajudas,
               'new_path': router.to_path(new)}
    return TemplateResponse(context)
Esempio n. 3
0
def index():
    cmd = facade.list_autoajudas_cmd()
    autoajuda_list = cmd()
    short_form=facade.autoajuda_short_form()
    autoajuda_short = [short_form.fill_with_model(m) for m in autoajuda_list]
    return JsonResponse(autoajuda_short)