~unifield-team/unifield-web/uf-2235

« back to all changes in this revision

Viewing changes to openobject/tools/_expose.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:
38
38
from mako.template import Template
39
39
from mako.lookup import TemplateLookup
40
40
 
41
 
from openobject.tools import rpc
42
 
from openobject.tools import utils
 
41
from openobject import tools
43
42
 
44
43
 
45
44
__all__ = ['find_resource', 'load_template', 'render_template', 'expose', 'register_template_vars']
69
68
 
70
69
 
71
70
filters = ["__content"]
72
 
imports = ["from openobject.tools.utils import content as __content"]
 
71
imports = ["from openobject.tools import content as __content"]
73
72
 
74
73
class TL(TemplateLookup):
75
74
    
132
131
    return {
133
132
        'session': cherrypy.session,
134
133
        'request': cherrypy.request,
135
 
        'config': utils.config,
 
134
        'config': tools.config,
136
135
        'root': cherrypy.request.app.root,
137
136
    }
138
137
 
140
139
def _py_vars():
141
140
 
142
141
    return {
143
 
        'url': utils.url,
144
 
        'attrs': utils.attrs,
145
 
        'attr_if': utils.attr_if,
146
 
        'checker': lambda e: utils.attr_if('checked', e),
147
 
        'selector': lambda e: utils.attr_if('selected', e),
148
 
        'readonly': lambda e: utils.attr_if('readonly', e),
149
 
        'disabled': lambda e: utils.attr_if('disabled', e),
150
 
    }
151
 
 
152
 
 
153
 
def _root_vars():
154
 
    return {
155
 
        'rpc': rpc,
156
 
    }
157
 
 
 
142
        'url': tools.url,
 
143
        'attrs': tools.attrs,
 
144
        'attr_if': tools.attr_if,
 
145
        'checker': lambda e: tools.attr_if('checked', e),
 
146
        'selector': lambda e: tools.attr_if('selected', e),
 
147
        'readonly': lambda e: tools.attr_if('readonly', e),
 
148
        'disabled': lambda e: tools.attr_if('disabled', e),
 
149
    }
158
150
 
159
151
register_template_vars(_cp_vars, 'cp')
160
152
register_template_vars(_py_vars, 'py')
161
 
register_template_vars(_root_vars, None)
162
153
 
163
154
def _get_vars():
164
155