FlaskBB Form Hooks¶
-
flaskbb.plugins.spec.
flaskbb_form_new_post_save
(form)¶ 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_new_post
(form)¶ Hook for modifying the
ReplyForm
.For example:
@impl def flaskbb_form_new_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_new_topic
(form)¶ Hook for modifying the
NewTopicForm
Parameters: form – The NewTopicForm
class.
-
flaskbb.plugins.spec.
flaskbb_form_new_topic_save
(form, topic)¶ 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.
-
flaskbb.plugins.spec.
flaskbb_form_registration
(form)¶ Hook for modifying the
RegisterForm
.Parameters: form – The form class