def index(): cmd = facade.list_litnacionals_cmd() litnacionals = cmd() public_form = facade.litnacional_public_form() litnacional_public_dcts = [public_form.fill_with_model(litnacional) for litnacional in litnacionals] context = {'litnacionals': litnacional_public_dcts,'admin_path':router.to_path(admin)} return TemplateResponse(context)
def index(): cmd = facade.list_litnacionals_cmd() litnacionals = cmd() edit_path = router.to_path(edit) delete_path = router.to_path(delete) short_form = facade.litnacional_short_form() def short_litnacional_dict(litnacional): litnacional_dct = short_form.fill_with_model(litnacional) litnacional_dct['edit_path'] = router.to_path(edit_path, litnacional_dct['id']) litnacional_dct['delete_path'] = router.to_path(delete_path, litnacional_dct['id']) return litnacional_dct short_litnacionals = [short_litnacional_dict(litnacional) for litnacional in litnacionals] context = {'litnacionals': short_litnacionals, 'new_path': router.to_path(new)} return TemplateResponse(context)
def index(): cmd = facade.list_litnacionals_cmd() litnacional_list = cmd() short_form=facade.litnacional_short_form() litnacional_short = [short_form.fill_with_model(m) for m in litnacional_list] return JsonResponse(litnacional_short)