tabletop-frog/ttfrog/webserver/controllers/character_sheet.py
2024-02-04 16:12:03 -08:00

20 lines
569 B
Python

from ttfrog.webserver.controllers.base import BaseController, DeferredSelectField
from ttfrog.db.schema import Character, Ancestry
from wtforms_alchemy import ModelForm
from wtforms.fields import SubmitField
class CharacterForm(ModelForm):
class Meta:
model = Character
exclude = ['slug']
save = SubmitField()
delete = SubmitField()
ancestry = DeferredSelectField('Ancestry', model=Ancestry, coerce=str, validate_choice=True)
class CharacterSheet(BaseController):
model = CharacterForm.Meta.model
model_form = CharacterForm