mirror of
https://github.com/wassname/flask-security.git
synced 2026-07-02 17:00:14 +08:00
Clarify user model/register form interaction in docs.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user