session¶
- session¶
domain: server
language: python
class AbstractItem class
Description¶
Use the session property to get access to session object of the current
request from the client.
The session is a dictionary that has the following items:
ip- ip address of the useruser_info- dictionary containing information about the useruser_id- id identifying the useruser_name- name of the userrole_id- id of user rolerole_name- name of user role
Example¶
def on_open(item, params):
user_id = item.session['user_info']['user_id']
if user_id:
params['__filters'].append(['user_id', item.task.consts.FILTER_EQ, user_id])
def on_apply(item, delta, params):
user_id = item.session['user_info']['user_id']
if user_id:
for d in delta:
d.edit()
d.user_id.value = user_id
d.post()