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

def CMFDynamicViewFTI::browserdefault::BrowserDefaultMixin::setLayout (   self,
  layout 
)

Set the layout as the current view.

'layout' should be one of the list returned by getAvailableLayouts(), but it
is not enforced. If a default page has been set with setDefaultPage(), it is
turned off by calling setDefaultPage(None).

Definition at line 171 of file browserdefault.py.

00171                                :
        """Set the layout as the current view.

        'layout' should be one of the list returned by getAvailableLayouts(), but it
        is not enforced. If a default page has been set with setDefaultPage(), it is
        turned off by calling setDefaultPage(None).
        """
        if not layout or not isinstance(layout, str):
            raise ValueError, ("layout must be a non empty string, got %s(%s)" %
                               (layout, type(layout)))

        defaultPage = self.getDefaultPage()
        if defaultPage is None and layout == self.getLayout():
            return

        if self.hasProperty('layout'):
            self.manage_changeProperties(layout = layout)
        else:
            if getattr(aq_base(self), 'layout', _marker) is not _marker:
                # Archetypes remains? clean up
                old = self.layout
                if old and not isinstance(old, basestring):
                    raise RuntimeError, ("layout attribute exists on %s and is"
                                         "no string: %s" % (self, type(old)))
                delattr(self, 'layout')

            self.manage_addProperty('layout', layout, 'string')

        self.setDefaultPage(None)

    security.declareProtected(View, 'getDefaultLayout')
    def getDefaultLayout(self):


Generated by  Doxygen 1.6.0   Back to index