10.1.12. Class cerebro.aclasses.Users

class cerebro.aclasses.Users[source]

Users class.

Methods

The user list consists of users (Cerebro user accounts) and material resources - items/units which do not have actual user accounts but are involved in production process, for example, an editing post or video camera are material resources.

users = cerebro.core.users()    
DATA_ = ''

Fields of user data tuple

DATA_EMAIL = 6

User’s E-mail address.

DATA_FIRST_NAME = 4

User first name.

DATA_FLAGS = 2

User flags.

DATA_FULL_NAME = 1

User full name.

DATA_ICQ = 8

User’s ICQ/Skype ID.

DATA_ID = 0

User ID.

DATA_LAST_NAME = 5

User last name.

DATA_LOGIN = 3

User login.

DATA_PHONE = 7

User’s phone number.

FLAG_ = ''

User flags

FLAG_IS_RESOURCE = 1

Is a material resource.

data()[source]
Returns:a list of tuples on users.
Return type:list(tuple,)
is_resource(user_flags)[source]
Parameters:user_flags (int) – user flag values.
Returns:True, if flag is set to ‘material resource’.
Return type:bool

an example of picking material resources out of a general user list:

resources = list()
users = cerebro.core.users()
for user in users.data():
        if cerebro.aclasses.Users.is_resource(user[users.DATA_FLAGS]) == True:
                resources.append(user)