~unifield-team/unifield-web/uf17

« back to all changes in this revision

Viewing changes to addons/openerp/tools/tools.py

  • Committer: ame (Tiny)
  • Date: 2010-01-07 07:47:47 UTC
  • Revision ID: ame@tinyerp.com-20100107074747-sqc1cmm24gofqmuh
[REF] separating base API to openobject
[REF] removed all openerp related stuffs from base api

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
import tempfile
33
33
import datetime as DT
34
34
 
35
 
import cherrypy
36
 
from formencode import NestedVariables
37
 
 
38
35
from openobject.tools import rpc
39
36
 
40
37
 
41
 
def nestedvars_tool():
42
 
    if hasattr(cherrypy.request, 'params'):
43
 
        cherrypy.request.params = NestedVariables.to_python(cherrypy.request.params or {})
44
 
 
45
 
cherrypy.tools.nestedvars = cherrypy.Tool("before_handler", nestedvars_tool)
46
 
cherrypy.lowercase_api = True
47
 
 
48
 
 
49
38
def expr_eval(string, context={}):
50
39
    context['uid'] = rpc.session.uid
51
40
    context['current_date'] = time.strftime('%Y-%m-%d')