Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Private Member Functions
five.customerize.zpt.TTWViewTemplateRenderer Class Reference

List of all members.

Public Member Functions

def __init__
def __call__
def __of__

Public Attributes


Private Member Functions

def _getView

Detailed Description

The view object for the TTW View Template.

When a TTWViewTemplate-based view is looked up, an object of this
class is instantiated.  It holds a reference to the
TTWViewTemplate object which it will use in the render process

Definition at line 55 of file

Constructor & Destructor Documentation

def five.customerize.zpt.TTWViewTemplateRenderer.__init__ (   self,
  permission = None 

Definition at line 64 of file

00065     def __init__(self, context, request, template, view, permission=None):
00066         self.context = context
00067         self.request = request
00068         self.template = template
00069         self.view = view
00070         self.permission = permission

Here is the caller graph for this function:

Member Function Documentation

def five.customerize.zpt.TTWViewTemplateRenderer.__call__ (   self,
Render the TTWViewTemplate-based view.

Definition at line 71 of file

00072     def __call__(self, *args, **kwargs):
00073         """Render the TTWViewTemplate-based view.
00074         """
00075         view = self._getView()
00076         # we need to override the template's context and request as
00077         # they generally point to the wrong objects (a template's
00078         # context usually is what it was acquired from, which isn't
00079         # what the context is for a view template).
00080         bound_names = {'context': self.context,
00081                        'request': self.request,
00082                        'view': view}
00083         template = self.template.__of__(self.context)
00084         return template._exec(bound_names, args, kwargs)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 103 of file

00104     def __of__(self, obj):
00105         return self

Definition at line 85 of file

00086     def _getView(self):
00087         checkPermission(self.permission, self.context)
00088         view = self.view
00089         if view is not None:
00090             # Filesystem-based view templates are trusted code and
00091             # have unrestricted access to the view class.  We simulate
00092             # that for TTW templates (which are trusted code) by
00093             # creating a subclass with unrestricted access to all
00094             # subobjects.
00095             class TTWView(view):
00096                 __allow_access_to_unprotected_subobjects__ = 1
00097             view = TTWView(self.context, self.request)
00098         return view

Here is the caller graph for this function:

Member Data Documentation

Definition at line 65 of file

Definition at line 69 of file

Definition at line 66 of file

Definition at line 67 of file

Definition at line 68 of file

The documentation for this class was generated from the following file: