[IMP] Move some qweb rendering context vars from website#ir.qweb to server#ir.ui.view
bzr revid: fme@openerp.com-20140206161316-jw7luqon476widcm
This commit is contained in:
parent
b112d5d2f1
commit
2d4fb97696
|
@ -137,16 +137,10 @@ class view(osv.osv):
|
|||
qcontext.update(
|
||||
website=request.website,
|
||||
url_for=website.url_for,
|
||||
keep_query=website.keep_query,
|
||||
slug=website.slug,
|
||||
res_company=request.website.company_id,
|
||||
user_id=self.pool.get("res.users").browse(cr, uid, uid),
|
||||
editable=False,
|
||||
|
||||
# TODO: move this in server's ir.ui.view
|
||||
request=request,
|
||||
json=simplejson,
|
||||
quote_plus=werkzeug.url_quote_plus,
|
||||
)
|
||||
|
||||
# add some values
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import fnmatch
|
||||
import inspect
|
||||
import itertools
|
||||
import logging
|
||||
|
@ -7,7 +6,6 @@ import math
|
|||
import re
|
||||
import urlparse
|
||||
|
||||
import simplejson
|
||||
import werkzeug
|
||||
import werkzeug.exceptions
|
||||
import werkzeug.wrappers
|
||||
|
@ -24,17 +22,6 @@ from openerp.addons.web.http import request, LazyResponse
|
|||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
def keep_query(*args, **kw):
|
||||
if not args and not kw:
|
||||
args = ('*',)
|
||||
params = kw.copy()
|
||||
query_params = frozenset(werkzeug.url_decode(request.httprequest.query_string).keys())
|
||||
for keep_param in args:
|
||||
for param in fnmatch.filter(query_params, keep_param):
|
||||
if param not in params and param in request.params:
|
||||
params[param] = request.params[param]
|
||||
return werkzeug.urls.url_encode(params)
|
||||
|
||||
def url_for(path_or_uri, lang=None):
|
||||
if isinstance(path_or_uri, unicode):
|
||||
path_or_uri = path_or_uri.encode('utf-8')
|
||||
|
|
Loading…
Reference in New Issue