Logo Search packages:      
Sourcecode: zope-archetypes version File versions

def Archetypes::ArchetypeTool::ArchetypeTool::listRegisteredTypes (   self,
  inProject = None 
)

Type/Schema Management.

Return the list of sorted types

Definition at line 464 of file ArchetypeTool.py.

00464                                                  :
        """Return the list of sorted types"""
        tt = getToolByName(self, "portal_types")
        def isRegistered(type, tt=tt):
            return tt.getTypeInfo(type['name']) != None

        def type_sort(a, b):
            v = cmp(a['package'], b['package'])
            if v != 0: return v
            c = cmp(a['klass'].__class__.__name__,
                    b['klass'].__class__.__name__)

            if c == 0:
                return cmp(a['package'], b['package'])
            return c

        values = listTypes()
        values.sort(type_sort)
        if inProject:
            values = [v for v in values if isRegistered(v)]

        return values


    security.declareProtected(CMFCorePermissions.View,
                              'getTypeSpec')


Generated by  Doxygen 1.6.0   Back to index