5.2.7 draco.user -- the User object

The User class is a global Draco object that provides functionality for user variables. User variables are global variables that are bound to the userid of the current session. The global instance of the User class is stored under the name user in the current module.

User variables depend on database access and require a logged in session. You can check if user variables are available by testing the user instance for non-zeroness.

The User object is a namespace. Use Python's dictionary notation to get, set or remove user variables from the User object. A small example:

from draco.user import user

user['ham'] = 'spam'
del user['ham']

class User( )
Global Draco object that implements user variables.

The public methods of User are:

namespace( scope)
Return a user subnamespace with scope scope. User namespaces with different scopes are independant. The default namespace (the one available from the global User object) has the scope '__system__'.