Logo Search packages:      
Sourcecode: zope-cmfdynamicviewfti version File versions  Download package

def CMFDynamicViewFTI::fti::DynamicViewTypeInformation::getViewMethod (   self,
  context,
  enforce_available = False,
  check_exists = False 
)

Get view method (aka layout) name from context

Return -- view method from context or default view name

Definition at line 140 of file fti.py.

00140                                                                                  :
        """Get view method (aka layout) name from context

        Return -- view method from context or default view name
        """
        default = self.getDefaultViewMethod(context)
        layout = getattr(aq_base(context), 'layout', None)

        if safe_callable(layout):
            layout = layout()
        if not layout:
            return default
        if not isinstance(layout, basestring):
            raise TypeError, "layout of %s must be a string, got %s" % (
                              repr(context), type(layout))
        if enforce_available:
            available = self.getAvailableViewMethods(context)
            if layout not in available:
                return default
        if check_exists:
            method = getattr(context, layout, None)
            if method is None:
                return default
        return layout

    security.declareProtected(View, 'getDefaultPage')
    def getDefaultPage(self, context, check_exists=False):


Generated by  Doxygen 1.6.0   Back to index