def index(): banking = get_banking() return { "accounts": banking.accounts, "account_types": { 1: "Cash", 2: "Bank", 3: "Asset", 4: "Credit card", 5: "Liability", } }
def view(id): banking = get_banking() return { "account": next(x for x in banking.accounts if x.id == id), }
def view(id): banking = get_banking() return {"account": next(x for x in banking.accounts if x.id == id)}
def index(): banking = get_banking() return { "accounts": banking.accounts, "account_types": {1: "Cash", 2: "Bank", 3: "Asset", 4: "Credit card", 5: "Liability"}, }