Bases: stalker.core.models.Entity
The user class is designed to hold data about a User in the system.
There are a couple of points to take your attention to:
The code attribute is derived from the nice_name as it is in a SimpleEntity, but the nice_name is derived from the login_name instead of the name attribute, so the code of a User and a SimpleEntity will be different then each other. The formatting of the code attribute is as follows:
- no underscore character is allowed, so while in the SimpleEntity class the code could have underscores, in User class it is not allowed.
- all the letters in the code will be converted to lower case.
Other than this two new rules all the previous formatting rules from the SimpleEntity are still in charge.
The name is a synonym of the login_name, so changing one of them will change the other.
Parameters: |
|
---|
Methods
__init__(**kwargs[, department, email, ...]) | |
check_password(raw_password) | Checks the given raw_password. |
Attributes
code | The code name of this object. |
created_by | The User who has created this object. |
created_by_id | |
date_created | A datetime.datetime instance showing the creation date and time of this object. |
date_updated | A datetime.datetime instance showing the update date and time of this object. |
department | Department of the user |
department_id | |
description | Description of this object. |
email of the user, accepts strings or unicodes | |
entity_id | |
entity_type | |
first_name | first name of the user, accepts string or unicode |
id | |
initials | The initials of the user. |
last_login | The last login time of this user. |
last_name | The last name of the user. |
login_name | The login name of the user. |
name | Name of this object |
nice_name | Nice name of this object. |
notes | All the Notess attached to this entity. |
password | The password of the user. |
permission_groups | Permission groups that this users is a member of. |
projects | The list of Projects those the current user assigned to. |
projects_lead | Projects lead by this user. |
reviews | All the Reviews about this Entity. |
sequences_lead | Sequences lead by this user. |
tags | A list of tags attached to this object. |
tasks | Tasks assigned to this user. |
type | The type of the object. |
type_id | |
updated_by | The User who has updated this object. |
updated_by_id | |
user_id |
Department of the user
email of the user, accepts strings or unicodes
first name of the user, accepts string or unicode
The last name of the user.
It is a string and can be None or empty string
Name of this object
The initials of the user.
If not spesified, it is the upper case form of first letters of the first_name and last_name
The password of the user.
It is scrambled before it is stored.
Permission groups that this users is a member of.
Accepts PermissionGroup object.
The last login time of this user.
It is an instance of datetime.datetime class.
Checks the given raw_password.
Checks the given raw_password with the current Users objects encrypted password.
The list of Projects those the current user assigned to.
returns a list of Project objects. It is a read-only attribute. To assign a User to a Project, you need to create a new Task with the resources is set to this User and assign the Task to the Project by setting the project attribute of the Task to the Project.
The code name of this object.
It accepts string or unicode values and any other kind of objects will be converted to string. In any update to the name attribute the code also will be updated. If the code is not initialized or given as None, it will be set to the uppercase version of the nice_name attribute. Setting the code attribute to None will reset it to the default value. The default value is the upper case form of the nice_name.
A datetime.datetime instance showing the creation date and time of this object.
A datetime.datetime instance showing the update date and time of this object.
Description of this object.
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.
There is also the code attribute which is simply the upper case form of nice_name if it is not defined differently (i.e set to another value).
All the Notess attached to this entity.
It is a list of Note instances or an empty list, setting it None will raise a TypeError.
All the Reviews about this Entity.
It is a list of Review instances or an empty list, setting it None will raise a TypeError.
A list of tags attached to this object.
It is a list of Tag instances which shows the tags of this object
The type of the object.
It is an instance of Type with a proper target_entity_type.