def view(id): t = Template(file='templates/view.html') data = db[id] t.name = data['name'] t.item_list = data['items'] t.since = data['since'] t.place = data['place'] return str(t)
def edit(id): t = Template(file='templates/edit.html') data = db[id] t.identifier = id t.name = data['name'] t.content = "\n".join(x for x in data['items']) t.since = data['since'] t.place = data['place'] return str(t)