Back to index

plone3  3.1.7
_vocabulary.py
Go to the documentation of this file.
00001 from zope.interface import Interface, Attribute
00002 
00003 class IVocabulary(Interface):
00004     """ interface for vocabularies used in fields """
00005 
00006     def getDisplayList(self, instance):
00007         """ returns an object of class DisplayList as defined in
00008             Products.Archetypes.utils.
00009 
00010             The instance of the content is given as parameter.
00011         """
00012  
00013     def getVocabularyDict(self, instance):
00014         """ returns the vocabulary as a dictionary with a string key and a
00015             string value. If it is not a flat vocabulary, the value is a
00016             tuple with a string and a sub-dictionary with the same format
00017             (or None if its a leave).
00018 
00019             Example for a flat vocabulary-dictionary:
00020             {'key1':'Value 1', 'key2':'Value 2'}
00021 
00022             Example for a hierachical:
00023             {'key1':('Value 1',{'key1.1':('Value 1.1',None)}), 'key2':('Value 2',None)}
00024 
00025             The instance of the content is given as parameter.
00026         """
00027 
00028     def isFlat(self):
00029         """ returns true if the underlying vocabulary is flat, otherwise
00030             if its hierachical (tree-like) it returns false.
00031         """
00032 
00033     def showLeafsOnly(self):
00034         """ returns true for flat vocabularies. In hierachical (tree-like)
00035             vocabularies it defines if only leafs should be displayed, or
00036             knots and leafs.
00037         """