diff options
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: |
