-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move IVocabularyFactory to zope.schema.interfaces.
Note that this doesn't require BBB. IVocabularyFactory's location at zope.app.schema.interfaces was introduced only a month back, therefore never released.
- Loading branch information
0 parents
commit 12637b8
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
############################################################################## | ||
# | ||
# Copyright (c) 2002 Zope Corporation and Contributors. | ||
# All Rights Reserved. | ||
# | ||
# This software is subject to the provisions of the Zope Public License, | ||
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. | ||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED | ||
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS | ||
# FOR A PARTICULAR PURPOSE. | ||
# | ||
############################################################################## | ||
"""Content Type convenience lookup functions | ||
$Id$ | ||
""" | ||
__docformat__ = 'restructuredtext' | ||
from zope.interface import classProvides | ||
from zope.schema.interfaces import IVocabularyFactory | ||
from zope.app.interface import queryType | ||
from zope.app.content.interfaces import IContentType | ||
from zope.app.component.vocabulary import UtilityVocabulary | ||
|
||
def queryContentType(object): | ||
"""Returns the interface implemented by object which implements | ||
`IContentType`.""" | ||
return queryType(object, IContentType) | ||
|
||
class ContentTypesVocabulary(UtilityVocabulary): | ||
classProvides(IVocabularyFactory) | ||
interface = IContentType |