l.s.w.v.StormVocabularyBase(FilteredVocabularyBase) : class documentation

Part of lp.services.webapp.vocabulary View In Hierarchy

Known subclasses: lp.code.vocabularies.gitrepository.GitRepositoryVocabulary, lp.services.webapp.vocabulary.NamedStormVocabulary, lp.snappy.vocabularies.SnapDistroArchSeriesVocabulary, lp.snappy.vocabularies.SnappyDistroSeriesVocabulary, lp.snappy.vocabularies.SnappySeriesVocabulary

A base class for widgets that are rendered to collect values for attributes that are Storm references.

So if a content class behind some form looks like:

class Foo(StormBase):
id = Int(...) bar_id = Int(...) bar = Reference(bar_id, ...) ...

Then the vocabulary for the widget that captures a value for bar should derive from StormVocabularyBase.

Method __init__ Undocumented
Method searchForTerms Undocumented
Method search Undocumented
Method toTerm Undocumented
Method __iter__ Return an iterator which provides the terms from the vocabulary.
Method __len__ Undocumented
Method __contains__ Undocumented
Method getTerm Undocumented
Method getTermByToken Undocumented
Method emptySelectResults Return a SelectResults object without any elements.
Method _entries Undocumented

Inherited from FilteredVocabularyBase:

Method __getattribute__ Undocumented
Method supportedFilters Undocumented
def __init__(self, context=None):
def searchForTerms(self, query=None, vocab_filter=None):
def search(self, query, vocab_filter=None):
def toTerm(self, obj):
def _entries(self):
def __iter__(self):
Return an iterator which provides the terms from the vocabulary.
def __len__(self):
def __contains__(self, obj):
def getTerm(self, value):
def getTermByToken(self, token):
def emptySelectResults(self):
Return a SelectResults object without any elements.

This is to be used when no search string is given to the search() method of subclasses, in order to be consistent and always return a SelectResults object.

API Documentation for Launchpad, generated by pydoctor at 2019-06-20 00:00:12.