tabletop-frog/ttfrog/webserver/controllers.py

17 lines
455 B
Python
Raw Permalink Normal View History

2024-01-28 00:46:19 -08:00
from tg import expose
from tg import TGController
from tg import tmpl_context
from ttfrog.db import db
from ttfrog.db.schema import Character
class RootController(TGController):
def _before(self, *args, **kwargs):
tmpl_context.project_name = 'TableTop Frog'
@expose('index.html')
def index(self):
ancestries = [row._mapping for row in db.query(db.ancestry).all()]
return dict(page='index', content=str(ancestries))