FlaskBB Form Hooks¶
-
flaskbb.plugins.spec.
flaskbb_form_post
(form)[source]¶ Hook for modifying the
ReplyForm
.For example:
@impl def flaskbb_form_post(form): form.example = TextField("Example Field", validators=[ DataRequired(message="This field is required"), Length(min=3, max=50)])
Parameters: form – The ReplyForm
class.
-
flaskbb.plugins.spec.
flaskbb_form_post_save
(form, post)[source]¶ Hook for modifying the
ReplyForm
.This hook is called while populating the post object with the data from the form. The post object will be saved after the hook call.
Parameters: - form – The form object.
- post – The post object.
-
flaskbb.plugins.spec.
flaskbb_form_topic
(form)[source]¶ Hook for modifying the
NewTopicForm
For example:
@impl def flaskbb_form_topic(form): form.example = TextField("Example Field", validators=[ DataRequired(message="This field is required"), Length(min=3, max=50)])
Parameters: form – The NewTopicForm
class.
-
flaskbb.plugins.spec.
flaskbb_form_topic_save
(form, topic)[source]¶ Hook for modifying the
NewTopicForm
.This hook is called while populating the topic object with the data from the form. The topic object will be saved after the hook call.
Parameters: - form – The form object.
- topic – The topic object.