def index(): cmd = facade.list_bibliass_cmd() bibliass = cmd() public_form = facade.biblias_public_form() biblias_public_dcts = [public_form.fill_with_model(biblias) for biblias in bibliass] context = {'bibliass': biblias_public_dcts,'admin_path':router.to_path(admin)} return TemplateResponse(context)
def index(): cmd = facade.list_bibliass_cmd() bibliass = cmd() edit_path = router.to_path(edit) delete_path = router.to_path(delete) short_form = facade.biblias_short_form() def short_biblias_dict(biblias): biblias_dct = short_form.fill_with_model(biblias) biblias_dct['edit_path'] = router.to_path(edit_path, biblias_dct['id']) biblias_dct['delete_path'] = router.to_path(delete_path, biblias_dct['id']) return biblias_dct short_bibliass = [short_biblias_dict(biblias) for biblias in bibliass] context = {'bibliass': short_bibliass, 'new_path': router.to_path(new)} return TemplateResponse(context)
def index(): cmd = facade.list_bibliass_cmd() biblias_list = cmd() short_form=facade.biblias_short_form() biblias_short = [short_form.fill_with_model(m) for m in biblias_list] return JsonResponse(biblias_short)