tabletop-frog/ttfrog/webserver/controllers/root.py

17 lines
494 B
Python
Raw Normal View History

2024-01-28 00:46:19 -08:00
from tg import expose
2024-01-28 22:14:50 -08:00
2024-01-28 00:46:19 -08:00
from ttfrog.db import db
2024-01-28 22:14:50 -08:00
from ttfrog.webserver.controllers.base import BaseController
2024-01-28 14:31:50 -08:00
from ttfrog.webserver.controllers.character_sheet import CharacterSheetController
2024-01-28 00:46:19 -08:00
2024-01-28 22:14:50 -08:00
class RootController(BaseController):
2024-01-28 00:46:19 -08:00
2024-01-28 22:14:50 -08:00
# serve character sheet interface on /sheet
2024-01-28 14:31:50 -08:00
sheet = CharacterSheetController()
2024-01-28 00:46:19 -08:00
@expose('index.html')
def index(self):
ancestries = [row._mapping for row in db.query(db.ancestry).all()]
2024-01-28 22:14:50 -08:00
return self.output(content=str(ancestries))