Archetypes:フィールドへのVocabularyの与え方

以下は、Products.Archetypes.Field.FieldクラスのVocabularyメソッドのdocstringです。

        Returns a DisplayList.

        Uses self.vocabulary as source.

        1) Static vocabulary

           - is already a DisplayList
           - is a list of 2-tuples with strings (see above)
           - is a list of strings (in this case a DisplayList
             with key=value will be created)

        2) Dynamic vocabulary:

           - precondition: a content_instance is given.

           - has to return a:

                * DisplayList or
                * list of strings or
                * list of 2-tuples with strings:
                    '[("key1","value 1"),("key 2","value 2"),]'

           - the output is postprocessed like a static vocabulary.

           - vocabulary is a string:
                if a method with the name of the string exists it will be called

           - vocabulary is a class implementing IVocabulary:
                the "getDisplayList" method of the class will be called.

        3) Zope 3 vocabulary factory vocabulary
        
            - precondition: a content_instance is given
            
            - self.vocabulary_factory is given
            
            - a named utility providing zope.schema.interfaces.IVocbularyFactory 
              exists for the name self.vocabulary_factory.