pyfarm.models.user module¶
User and Role Models¶
Stores users and their roles in the database.
-
class
pyfarm.models.user.
User
(**kwargs)[source]¶ Bases:
flask_sqlalchemy.Model
,flask_login.UserMixin
,pyfarm.models.core.mixins.ReprMixin
Stores information about a user including the roles they belong to
-
REPR_COLUMNS
= ('id', 'username')¶
-
active
¶ Enables or disables a particular user across the entire system
-
email
¶ Contact email for registration and possible notifications
-
expiration
¶ User expiration. If this value is set then the user will no longer be able to access PyFarm past the expiration.
-
has_roles
(allowed=None, required=None)[source]¶ checks the provided arguments against the roles assigned
-
id
¶
-
jobgroups
¶
-
jobs
¶
-
last_login
¶ The last date that this user was logged in.
-
onetime_code
¶ SHA256 one time use code which can be used for unique urls such as for password resets.
-
password
¶ The password used to login
-
roles
¶
-
subscribed_jobs
¶
-
username
¶ The username used to login.
-
-
class
pyfarm.models.user.
Role
(**kwargs)[source]¶ Bases:
flask_sqlalchemy.Model
Stores role information that can be used to give a user access to individual resources.
-
active
¶ Enables or disables a role. Disabling a role will prevent any users of this role from accessing PyFarm
-
classmethod
create
(name, description=None)[source]¶ Creates a role by the given name or returns an existing role if it already exists.
-
description
¶ Human description of the role.
-
expiration
¶ Role expiration. If this value is set then the role, and anyone assigned to it, will no longer be able to access PyFarm past the expiration.
-
id
¶
-
name
¶ The name of the role
-
users
¶
-