This module contains some helper functions used to save and load sessions in OdooRPC.
Return the session configuration identified by name from the rc_file file.
>>> import odoorpc
>>> from pprint import pprint as pp
>>> pp(odoorpc.session.get('foo'))
{'database': 'db_name',
'host': 'localhost',
'passwd': 'password',
'port': 8069,
'protocol': 'jsonrpc',
'timeout': 120,
'type': 'ODOO',
'user': 'admin'}
Raise: | ValueError (wrong session name) |
---|
Return all session configurations from the rc_file file.
>>> import odoorpc
>>> from pprint import pprint as pp
>>> pp(odoorpc.session.get_all())
{'foo': {'database': 'db_name',
'host': 'localhost',
'passwd': 'password',
'port': 8069,
'protocol': 'jsonrpc',
'timeout': 120,
'type': 'ODOO',
'user': 'admin'},
...}
Remove the session configuration identified by name from the rc_file file.
>>> import odoorpc
>>> odoorpc.session.remove('foo')
Raise: | ValueError (wrong session name) |
---|
Save the data session configuration under the name name in the rc_file file.
>>> import odoorpc
>>> odoorpc.session.save(
... 'foo',
... {'type': 'ODOO', 'host': 'localhost', 'protocol': 'jsonrpc',
... 'port': 8069, 'timeout': 120, 'database': 'db_name'
... 'user': 'admin', 'passwd': 'password'})