diff --git a/docs/customizing.rst b/docs/customizing.rst index 3aff81c..8bc5601 100644 --- a/docs/customizing.rst +++ b/docs/customizing.rst @@ -62,12 +62,9 @@ The following is a list of all the available context processor decorators: Forms ----- -All forms can be overridden in much the same way as context -processors. For each form used, you can specify a function that -returns the form class. This allows you to override/extend forms. For -example, to add extra fields to the register form:: - - security = Security(app, user_datastore) +All forms can be overridden. For each form used, you can specify a +replacement class. This allows you to add extra fields to the +register form or override validators:: from flask_security.forms import RegisterForm @@ -75,11 +72,10 @@ example, to add extra fields to the register form:: first_name = TextField('First Name', [Required()]) last_name = TextField('Last Name', [Required()]) - @security.register_form - def security_register_form(): - return ExtendedRegisterForm + security = Security(app, user_datastore, + register_form=ExtendedRegisterForm) -The following is a list of all the available form override decorators: +The following is a list of all the available form overrides: * ``login_form``: Login form * ``confirm_register_form``: Confirmable register form