diff --git a/docs/customizing.rst b/docs/customizing.rst index 8bc5601..d2c6018 100644 --- a/docs/customizing.rst +++ b/docs/customizing.rst @@ -75,6 +75,18 @@ register form or override validators:: security = Security(app, user_datastore, register_form=ExtendedRegisterForm) +For the ``register_form`` and ``confirm_register_form``, each field is +passed to the user model when a user is created. In the above case, +the ``first_name`` and ``last_name`` fields are passed directly to the +model, so the model should look like:: + + class User(db.Model, UserMixin): + id = db.Column(db.Integer, primary_key=True) + email = db.Column(db.String(255), unique=True) + password = db.Column(db.String(255)) + first_name = db.Column(db.String(255)) + last_name = db.Column(db.String(255)) + The following is a list of all the available form overrides: * ``login_form``: Login form