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

User.active

User.birth_date

User.children

User.created_at

User.created_by

User.created_by_id

User.deleted_at

User.dirty_fields

User.document_set

User.email

User.fs_uniquifier

User.genre

User.id

User.is_active

Returns True if the user is active.

User.is_anonymous

User.is_authenticated

User.last_name

User.name

User.password

User.roles

User.updated_at

User.userrolethrough_set

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[, ...])

User.calc_username()

Come up with the best 'username' based on how the app is configured (via SECURITY_USER_IDENTITY_ATTRIBUTES).

User.clone()

User.coerce([_coerce])

User.copy(method)

User.create(**query)

User.create_table([safe])

User.delete()

User.delete_by_id(pk)

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)

User.get_auth_token()

Constructs the user's authentication token.

User.get_by_id(pk)

User.get_fields([exclude, include, sort_order])

User.get_id()

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.

User.get_reset_token()

User.get_security_payload()

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.is_alias()

User.is_dirty()

User.noop()

User.raw(query)

User.reload()

User.replace([_Model__data])

User.replace_many(rows[, fields])

User.save(*args, **kwargs)

User.select(*fields)

User.set_by_id(key, value)

User.table_exists()

User.tf_send_security_token(method, **kwargs)

Generate and send the security code for two-factor.

User.truncate_table(**options)

User.unwrap()

User.update([_Model__data])

User.us_send_security_token(method, **kwargs)

Generate and send the security code for unified sign in.

User.validate_model()

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)