57 |
|
|
58 |
def call_with_ns(f, ns, arg=1): |
def call_with_ns(f, ns, arg=1): |
59 |
td = Rtd() |
td = Rtd() |
60 |
td.this = ns['here'] |
td.this = ns['context'] |
61 |
td._push(ns['request']) |
td._push(ns['request']) |
62 |
td._push(InstanceDict(td.this, td)) |
td._push(InstanceDict(td.this, td)) |
63 |
td._push(ns) |
td._push(ns) |
269 |
func_defaults = None |
func_defaults = None |
270 |
func_code = FuncCode((), 0) |
func_code = FuncCode((), 0) |
271 |
|
|
272 |
_default_bindings = {'name_context': 'here', |
_default_bindings = {'name_context': 'context', |
273 |
'name_container': 'container', |
'name_container': 'container', |
274 |
'name_m_self': 'template', |
'name_m_self': 'template', |
275 |
'name_subpath': 'traverse_subpath', |
'name_subpath': 'traverse_subpath', |
497 |
security=getSecurityManager() |
security=getSecurityManager() |
498 |
bound_names['user'] = security.getUser() |
bound_names['user'] = security.getUser() |
499 |
|
|
500 |
|
# backward compatibility; this is scheduled to be deprecated in a few months |
501 |
|
try: |
502 |
|
bound_names['here'] = bound_names['context'] |
503 |
|
except KeyError: |
504 |
|
# there isn't a 'context' binding yet |
505 |
|
self.ZBindings_edit(self._default_bindings) |
506 |
|
bound_names['context'] = bound_names['here'] |
507 |
|
|
508 |
# Retrieve the value from the cache. |
# Retrieve the value from the cache. |
509 |
keyset = {} |
keyset = {} |
510 |
if self.ZCacheable_isCachingEnabled(): |
if self.ZCacheable_isCachingEnabled(): |
511 |
for n in ('traverse_subpath', 'options'): |
for n in ('traverse_subpath', 'options'): |
512 |
keyset[n] = bound_names[n] |
keyset[n] = bound_names[n] |
513 |
keyset['here'] = bound_names['here'].absolute_url() |
keyset['context'] = bound_names['context'].absolute_url() |
514 |
result = self.ZCacheable_get(keywords=bound_names) |
result = self.ZCacheable_get(keywords=bound_names) |
515 |
if result is not None: |
if result is not None: |
516 |
# Got a cached value. |
# Got a cached value. |