app.models.user.User
- class app.models.user.User(*args, **kwargs)
Bases:
app.models.base.Base
,flask_security.core.UserMixin
User database model.
References
fs_uniquier field is required by flask-security-too: https://flask-security-too.readthedocs.io/en/stable/changelog.html#version-4-0-0
Attributes
Returns True if the user is active.
Methods
User.__init__
(*args, **kwargs)User.add_index
(*fields, **kwargs)User.alias
([alias])User.bind
(database[, bind_refs, ...])User.bind_ctx
(database[, bind_refs, ...])User.bulk_create
(model_list[, batch_size])User.bulk_update
(model_list, fields[, ...])Come up with the best 'username' based on how the app is configured (via
SECURITY_USER_IDENTITY_ATTRIBUTES
).User.coerce
([_coerce])User.copy
(method)User.create
(**query)User.create_table
([safe])User.delete_instance
([recursive, ...])User.dependencies
([search_nullable])User.drop_table
([safe, drop_sequences])User.ensure_password
(plain_text)User.filter
(*dq_nodes, **filters)User.get
(*query, **filters)Constructs the user's authentication token.
User.get_by_id
(pk)User.get_fields
([exclude, include, sort_order])Returns the user identification attribute.
User.get_or_create
(**kwargs)User.get_or_none
(*query, **filters)User.get_redirect_qparams
([existing])Return user info that will be added to redirect query params.
Serialize user object as response payload.
User.has_permission
(permission)Returns True if user has this permission (via a role it has).
User.has_role
(role)Returns True if the user identifies with the specified role.
User.index
(*fields, **kwargs)User.insert
([_Model__data])User.insert_from
(query, fields)User.insert_many
(rows[, fields])User.raw
(query)User.replace
([_Model__data])User.replace_many
(rows[, fields])User.save
(*args, **kwargs)User.select
(*fields)User.set_by_id
(key, value)User.tf_send_security_token
(method, **kwargs)Generate and send the security code for two-factor.
User.truncate_table
(**options)User.update
([_Model__data])User.us_send_security_token
(method, **kwargs)Generate and send the security code for unified sign in.
User.verify_and_update_password
(password)Returns
True
if the password is valid for the specified user.User.verify_auth_token
(data)Perform additional verification of contents of auth token.
User.verify_reset_token
(token)