BBB: DEPRECATED
The vocabulary directive has been deprecated and will be
removed in Zope 3.5. Use the utility directive instead to
register the class as a named utility:
Example:
<utility
provides="zope.schema.interfaces.IVocabularyFactory"
component="zope.app.gary.paths.Favorites"
name="garys-favorite-path-references"
/>
Previous documentation
Define a named vocabulary.
This associates a vocabulary name in the global vocabulary registry with a factory. Each name may only be defined once.
Additional keyword arguments may be passed to the factory by adding additional attributes beyond those listed here. This can be useful when using vocabularies which implement various kinds of filtering.
Example:
<vocabulary
name="garys-favorite-path-references"
factory="zope.app.gary.paths.Favorites" />
factory
*
-
GlobalObject
(default =
None)
Factory that returns an instance of the named vocabulary when called with the context object as the only argument. This should be a dotted-name that refers to a Python object.
name
*
-
TextLine
(default =
None)
Provides a title for the source type. The name of the vocabulary; this can be used as the value for the "vocabulary" argument to the Choice field constructor to cause this vocabulary to be used.
* = required