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

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

Get the default page from a folderish object

Non folderish objects don't have a default view.

If check_exists is enabled the method makes sure the object with the default
page id exists.

Return -- None for no default page or a string

Definition at line 148 of file fti.py.

00148                                                          :
        """Get the default page from a folderish object

        Non folderish objects don't have a default view.

        If check_exists is enabled the method makes sure the object with the default
        page id exists.

        Return -- None for no default page or a string
        """
        if not getattr(aq_base(context), 'isPrincipiaFolderish', False):
            return None # non folderish objects don't have a default page per se

        default_page = getattr(aq_base(context), 'default_page', None)
        if default_page is None:
            return None

        if safe_callable(default_page):
            default_page = default_page()
        if not default_page:
            return None
        if isinstance(default_page, (tuple, list)):
            default_page = default_page[0]
        if not isinstance(default_page, str):
            raise TypeError, ("default_page must be a string, got %s(%s):" %
                              (default_page, type(default_page)))

        if check_exists and not om_has_key(context, default_page):
            return None

        return default_page

    security.declareProtected(View, 'defaultView')
    def defaultView(self, context):


Generated by  Doxygen 1.6.0   Back to index