views:

23

answers:

1

In django orm I can use the 'verbose_name' kwarg to set a label that will be displayed in model forms. Now I'm dynamically generating WTForms for each model in a SQLAlchemy mapped backend, but I'm not sure where to associate a display text to use in the auto generated fields for each form. For example, in django I could do this:

class User(models.Model):
    name = CharField(max_length=50, verbose_name='Enter your username')
    password = CharField(max_length=50, verbose_name='Enter your password')

In SQLAlchemy:

class User(Base):
    name = Column(String)
    password = Column(String)

In this simple case, how could I associate the texts 'Enter your username' and 'Enter your password' with the 'name' and 'password' attributes respectively?