Back to index

plone3  3.1.7
Classes | Functions
Marshall.expression Namespace Reference

Classes

class  Expression

Functions

def createExprContext

Function Documentation

def Marshall.expression.createExprContext (   obj,
  kw 
)
Provides names for TALES expressions.

Definition at line 55 of file expression.py.

00055 
00056 def createExprContext(obj, **kw):
00057     """ Provides names for TALES expressions.
00058     """
00059     if obj is None:
00060         object_url = ''
00061     else:
00062         object_url = obj.absolute_url()
00063 
00064     user = getSecurityManager().getUser()
00065 
00066     data = {
00067         'object_url':   object_url,
00068         'object':       obj,
00069         'nothing':      None,
00070         'request':      getattr(obj, 'REQUEST', None),
00071         'modules':      SecureModuleImporter,
00072         'user':         user,
00073         }
00074     if kw.has_key('mimetype') and not kw.has_key('content_type'):
00075         # Alias content_type to mimetype
00076         kw['content_type'] = kw['mimetype']
00077     data.update(kw)
00078     for k in ('filename', 'content_type', 'data', 'mimetype'):
00079         data.setdefault(k, None)
00080     return getEngine().getContext(data)

Here is the call graph for this function: