Trees | Index | Help |
|
---|
Package zope :: Package schema :: Module vocabulary :: Class SimpleVocabulary |
|
object
--+
|
SimpleVocabulary
Method Summary | |
---|---|
Initialize the vocabulary given a list of terms. | |
See zope.schema.interfaces.IBaseVocabulary | |
See zope.schema.interfaces.IIterableVocabulary | |
See zope.schema.interfaces.IIterableVocabulary | |
Create a single term from data. (Class method) | |
Construct a vocabulary from a list of (token, value) pairs. (Class method) | |
Construct a vocabulary from a simple list. (Class method) | |
See zope.schema.interfaces.IBaseVocabulary | |
See zope.schema.interfaces.IVocabularyTokenized | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Class Variable Summary | |
---|---|
Implements |
__implemented__ = <implementedBy zope.schema.vocabulary....
|
ClassProvides |
__providedBy__ = <zope.interface.declarations.ClassProvi...
|
ClassProvides |
__provides__ = <zope.interface.declarations.ClassProvide...
|
Instance Method Details |
---|
__init__(self,
terms,
*interfaces)
|
__contains__(self,
value)
See zope.schema.interfaces.IBaseVocabulary
|
__iter__(self)See zope.schema.interfaces.IIterableVocabulary |
__len__(self)
See zope.schema.interfaces.IIterableVocabulary
|
getTerm(self, value)See zope.schema.interfaces.IBaseVocabulary |
getTermByToken(self, token)See zope.schema.interfaces.IVocabularyTokenized |
Class Method Details |
---|
createTerm(cls, *args)Create a single term from data. Subclasses may override this with a class method that creates a term of the appropriate type from the arguments. |
fromItems(cls, items, *interfaces)Construct a vocabulary from a list of (token, value) pairs. The order of the items is preserved as the order of the terms in the vocabulary. Terms are created by calling the class method createTerm() with the pair (value, token). One or more interfaces may also be provided so that alternate widgets may be bound without subclassing. |
fromValues(cls, values, *interfaces)Construct a vocabulary from a simple list. Values of the list become both the tokens and values of the terms in the vocabulary. The order of the values is preserved as the order of the terms in the vocabulary. Tokens are created by calling the class method createTerm() with the value as the only parameter. One or more interfaces may also be provided so that alternate widgets may be bound without subclassing. |
Class Variable Details |
---|
__implemented__
|
__providedBy__
|
__provides__
|
Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Fri Jun 24 12:01:25 2005 | http://epydoc.sf.net |