from flask_wtf import FlaskForm from wtforms import TextAreaField class EditorForm(FlaskForm): """ A text editor with formatting buttons and help. A rendering macro is defined in the template widgets/editor.html. """ # TODO: How to set DataRequired() dynamically? contents = TextAreaField() @property def value(self): return self.contents.data