Skip to main content

Component Architecture based Vocabulary Registry

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

This package provides a component architecture based vocabulary registry.

Component-based Vocabulary Registry

This package provides a vocabulary registry for zope.schema, based on the component architecture.

It replaces the zope.schema’s simple vocabulary registry when zope.app.schema package is imported, so it’s done automatically. All we need is provide vocabulary factory utilities:

>>> from zope.component import provideUtility
>>> from zope.schema.interfaces import IVocabularyFactory
>>> from zope.schema.vocabulary import SimpleTerm
>>> from zope.schema.vocabulary import SimpleVocabulary
>>> def SomeVocabulary(context=None):
...     terms = [SimpleTerm(1), SimpleTerm(2)]
...     return SimpleVocabulary(terms)
>>> provideUtility(SomeVocabulary, IVocabularyFactory,
...                name='SomeVocabulary')

Now we can get the vocabulary using standard zope.schema way:

>>> from zope.schema.vocabulary import getVocabularyRegistry
>>> vr = getVocabularyRegistry()
>>> voc = vr.get(None, 'SomeVocabulary')
>>> [term.value for term in voc]
[1, 2]

CHANGES

4.0.0 (2017-04-17)

  • Support for Python 3.5, 3.6 and PyPy has been added.

  • Added support for tox.

  • Drop dependency on zope.app.testing, since it was not needed.

3.6.0 (2017-04-17)

  • Package modernization including manifest.

3.5.0 (2008-12-16)

  • Remove deprecated vocabulary directive.

  • Add test for component-based vocabulary registry.

3.4.0 (2007-10-27)

  • Initial release independent of the main Zope tree.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zope.app.schema-4.0.0.tar.gz (8.3 kB view details)

Uploaded Source

File details

Details for the file zope.app.schema-4.0.0.tar.gz.

File metadata

File hashes

Hashes for zope.app.schema-4.0.0.tar.gz
Algorithm Hash digest
SHA256 1c89fcc727ff5a72a24be65c4d897a3bf4a1b1b067fd178d5e16c963fe84919c
MD5 7651d52d41ffa2a2ed4b116b86ac04e3
BLAKE2b-256 11538aaaabb3bc51f4cf0ab670ac17eba81cbf2064b6e2d8bc70612a9a7f5a62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page