stalker.models.auth.User¶
-
class
stalker.models.auth.User(name=None, login=None, email=None, password=None, departments=None, companies=None, groups=None, efficiency=1.0, rate=0.0, **kwargs)[source]¶ Bases:
stalker.models.entity.Entity,stalker.models.mixins.ACLMixinThe user class is designed to hold data about a User in the system.
Note
New to version 0.2.0 users can be assigned to a
Taskas a Watcher. Which can be used to inform the users in watchers list about the updates of certain Tasks.Note
It is now possible to define Vacations per user.
Note
Note
Parameters: - rate – For future usage a rate attribute is added to the User to record the daily cost of this user as a resource. It should be either 0 or a positive integer or float value. Default is 0.
- efficiency –
The efficiency is a multiplier for a user as a resource to a task and defines how much of the time spent for that particular task is counted as an actual effort. The default value is 1.0, lowest possible value is 0.0 and there is no upper limit.
The efficiency of a resource can be used for three purposes. First you can use it as a crude way to model a team. A team of 5 people should have an efficiency of 5.0. Keep in mind that you cannot track the members of the team individually if you use this feature. They always act as a group.
Another use is to model performance variations between your resources. Again, this is a fairly crude mechanism and should be used with care. A resource that isn’t every good at some task might be pretty good at another. This can’t be taken into account as the resource efficiency can only set globally for all tasks.
One another and interesting use is to model the availability of passive resources like a meeting room or a workstation or something that needs to be free for a task to take place but does not contribute to a task as an active resource.
All resources that do not contribute effort to the task, that is a passive resource, should have an efficiency of 0.0. Again a typical example would be a conference room. It’s necessary for a meeting, but it does not contribute any work.
- email (str) – holds the e-mail of the user, should be in [part1]@[part2] format
- login (str) – This is the login name of the user, it should be all lower case. Giving a string that has uppercase letters, it will be converted to lower case. It can not be an empty string or None and it can not contain any white space inside.
- departments (list of
Departments) – It is the departments that the user is a part of. It should be a list of Department objects. One user can be listed in multiple departments. - password (str) – it is the password of the user, can contain any character.
Stalker doesn’t store the raw passwords of the users. To check a stored
password with a raw password use
check_password()and to set the password you can use thepasswordproperty directly. - groups (list of
Group) – It is a list ofGroupinstances that this user belongs to. - tasks (list of
Tasks) – it is a list of Task objects which holds the tasks that this user has been assigned to - last_login (datetime.datetime) – it is a datetime.datetime object holds the last login date of the user (not implemented yet)
-
__init__(name=None, login=None, email=None, password=None, departments=None, companies=None, groups=None, efficiency=1.0, rate=0.0, **kwargs)¶
Methods
__init__([name, login, email, password, …])check_password(raw_password)Checks the given raw_password. Attributes
alternative_resource_in_taskscompaniesA descriptor that presents a read/write view of an object attribute. company_roleA list of Clients that this user is a part of.computed_resource_in_taskscreated_byThe Userwho has created this object.created_by_idThe id of the Userwho has created this entity.date_createdA datetime.datetimeinstance showing the creation date and time of this object.date_updatedA datetime.datetimeinstance showing the update date and time of this object.department_roleA list of Departments thatdepartmentsA descriptor that presents a read/write view of an object attribute. descriptionDescription of this object. efficiencyemailemail of the user, accepts string entities_createdentities_updatedentity_groupsentity_identity_typegeneric_dataThis attribute can hold any kind of data which exists in SOM. generic_textThis attribute can hold any text. groupsPermission groups that this users is a member of. html_classhtml_styleidUser.last_loginloginThe login name of the user. metadatanameName of this object nice_nameNice name of this object. notesAll the Notess attached to this entity.open_ticketsThe list of open Tickets that this user has.passwordThe password of the user. permissionsplural_class_namethe plural name of this class project_roleprojectsA descriptor that presents a read/write view of an object attribute. queryrateresponsible_ofA list of Taskinstances that this user is responsible of.tagsA list of tags attached to this object. tasksTasks assigned to this user.thumbnailthumbnail_idticketsThe list of Tickets that this user has.time_logsA list of TimeLoginstances which holds the time logs created for thisUser.tjp_idreturns TaskJuggler compatible id to_tjpoutputs a TaskJuggler formatted string typeThe type of the object. type_idThe id of the Typeof this entity.updated_byThe Userwho has updated this object.updated_by_idThe id of the Userwho has updated this entity.user_idvacationsA list of VacationinstanceswatchingTaskss that this user is-
department_role¶ A list of
Departments that this user is a part of
-
authentication_logs¶ A list of
AuthenticationLoginstances which holds the login/logout info for thisUser.
-
login¶ The login name of the user.
Can not be empty.
-
email¶ email of the user, accepts string
-
password¶ The password of the user.
It is scrambled before it is stored.
-
check_password(raw_password)[source]¶ Checks the given raw_password.
Checks the given raw_password with the current User object’s mangled password. Handles the encryption process behind the scene.
- Note:
- This function was updated to support both Python 2.7 and 3.5. It will now compare the string (str) versions of the given raw_password and the current Users object encrypted password.
-
tickets¶ The list of
Tickets that this user has.returns a list of
Ticketinstances which this user is the owner of.
-
open_tickets¶ The list of open
Tickets that this user has.returns a list of
Ticketinstances which has a status of Open that this user is assigned as the owner.
-
to_tjp¶ outputs a TaskJuggler formatted string
-
date_created¶ A
datetime.datetimeinstance showing the creation date and time of this object.
-
date_updated¶ A
datetime.datetimeinstance showing the update date and time of this object.
-
description¶ Description of this object.
-
generic_data¶ This attribute can hold any kind of data which exists in SOM.
-
generic_text¶ This attribute can hold any text.
-
name¶ Name of this object
-
nice_name¶ Nice name of this object.
It has the same value with the name (contextually) but with a different format like, all the white spaces replaced by underscores (“_”), all the CamelCase form will be expanded by underscore (_) characters and it is always lower case.
-
notes¶ All the
Notess attached to this entity.It is a list of
Noteinstances or an empty list, setting it to None will raise a TypeError.
-
plural_class_name¶ the plural name of this class
A list of tags attached to this object.
It is a list of
Taginstances which shows the tags of this object
-
tjp_id¶ returns TaskJuggler compatible id
-
type¶ The type of the object.
It is a
Typeinstance with a properType.target_entity_type.