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.

NOTE: This functionality has been replaced with zope.vocabularyregistry. These imports continue to work for backwards compatibility.

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:

>>> import zope.app.schema
>>> 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]

Configuration

This package provides configuration that sets security permissions and factories for the objects provided in zope.schema. The zope.security package must be installed to use it.

>>> from zope.configuration import xmlconfig
>>> _ = xmlconfig.string(r"""
... <configure xmlns="http://namespaces.zope.org/zope" i18n_domain="zope">
...   <include package="zope.app.schema" />
... </configure>
... """)

CHANGES

4.1.0 (2017-05-10)

  • Replaced the local implementation of ZopeVocabularyRegistry with one imported from zope.vocabularyregistry. Backwards compatibility imports remain.

4.0.1 (2017-05-10)

  • Packaging: Add the Python version and implementation classifiers.

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.

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.1.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zope.app.schema-4.1.0-py2.py3-none-any.whl (9.7 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for zope.app.schema-4.1.0.tar.gz
Algorithm Hash digest
SHA256 cf1b0f7d215fef4ac5a09888591174cb3ae5961499a502512934d14695090e75
MD5 e738543ed9271d80de84c687680118c9
BLAKE2b-256 3c1cddb149abddbdfc2567b4bb37a0e5048619940ea245cac80ea4ab7c0e6d92

See more details on using hashes here.

File details

Details for the file zope.app.schema-4.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for zope.app.schema-4.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b7caabffbd83e8f0bfa7fe2c6d401e045336c36e49e49cf1b06c55d349c721ee
MD5 43581b0ed3adbb3db6f87837f8242782
BLAKE2b-256 13b8f47e275d5e9fbca30b487545722456a10f07acfd5f9915b5822ac7c52c41

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