Metadata-Version: 2.1
Name: zope.app.schema
Version: 4.1.0
Summary: Component Architecture based Vocabulary Registry
Home-page: http://pypi.python.org/pypi/zope.app.schema
Author: Zope Corporation and Contributors
Author-email: zope-dev@zope.org
License: ZPL 2.1
Keywords: zope3 vocabulary registry local component
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Zope Public License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Framework :: Zope3
Provides-Extra: test
Provides-Extra: zcml
License-File: LICENSE.txt

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.


