diff options
| author | tsabi <csaba.toth@i3rendszerhaz.hu> | 2012-11-29 12:41:32 +0100 |
|---|---|---|
| committer | tsabi <csaba.toth@i3rendszerhaz.hu> | 2012-11-29 12:41:32 +0100 |
| commit | 76ca47d4fd0bd178fd7dfd2ea5b534d4e878a6f5 (patch) | |
| tree | 32339ef0c6869f21bb757f8ab6bce7faf8028c6b /addons/web/session.py | |
| parent | e2435d4f004a20636aef8a8ee2cc03c8cfc3e78c (diff) | |
| parent | c7772fdd82105ddf60cbec2517753bf927ce19ed (diff) | |
[MERGE] trunk
bzr revid: csaba.toth@i3rendszerhaz.hu-20121129114132-gfe3sn1p5t0mzofm
Diffstat (limited to 'addons/web/session.py')
| -rw-r--r-- | addons/web/session.py | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/addons/web/session.py b/addons/web/session.py index e57d3da5b45..523aaa9f1fa 100644 --- a/addons/web/session.py +++ b/addons/web/session.py @@ -10,8 +10,6 @@ import xmlrpclib import openerp -import nonliterals - _logger = logging.getLogger(__name__) #---------------------------------------------------------- @@ -81,8 +79,6 @@ class OpenERPSession(object): self._password = False self._suicide = False self.context = {} - self.contexts_store = {} - self.domains_store = {} self.jsonp_requests = {} # FIXME use a LRU def send(self, service_name, method, *args): @@ -222,49 +218,4 @@ class OpenERPSession(object): d['context'] = d return d - def eval_context(self, context_to_eval, context=None): - """ Evaluates the provided context_to_eval in the context (haha) of - the context. Also merges the evaluated context with the session's context. - - :param context_to_eval: a context to evaluate. Must be a dict or a - non-literal context. If it's a dict, will be - returned as-is - :type context_to_eval: openerpweb.nonliterals.Context - :returns: the evaluated context - :rtype: dict - - :raises: ``TypeError`` if ``context_to_eval`` is neither a dict nor - a Context - """ - ctx = dict( - self.base_eval_context, - **(context or {})) - - # adding the context of the session to send to the openerp server - ccontext = nonliterals.CompoundContext(self.context, context_to_eval or {}) - ccontext.session = self - return ccontext.evaluate(ctx) - - def eval_domain(self, domain, context=None): - """ Evaluates the provided domain using the provided context - (merged with the session's evaluation context) - - :param domain: an OpenERP domain as a list or as a - :class:`openerpweb.nonliterals.Domain` instance - - In the second case, it will be evaluated and returned. - :type domain: openerpweb.nonliterals.Domain - :param dict context: the context to use in the evaluation, if any. - :returns: the evaluated domain - :rtype: list - - :raises: ``TypeError`` if ``domain`` is neither a list nor a Domain - """ - if isinstance(domain, list): - return domain - - cdomain = nonliterals.CompoundDomain(domain) - cdomain.session = self - return cdomain.evaluate(context or {}) - # vim:et:ts=4:sw=4: |
