~hardware-certification/zope3/certify-staging-2.5

« back to all changes in this revision

Viewing changes to src/zope/app/content/__init__.py

  • Committer: Marc Tardif
  • Date: 2008-04-26 19:03:34 UTC
  • Revision ID: cr3@lime-20080426190334-u16xo4llz56vliqf
Initial import.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
##############################################################################
 
2
#
 
3
# Copyright (c) 2002 Zope Corporation and Contributors.
 
4
# All Rights Reserved.
 
5
#
 
6
# This software is subject to the provisions of the Zope Public License,
 
7
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
 
8
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 
9
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 
10
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 
11
# FOR A PARTICULAR PURPOSE.
 
12
#
 
13
##############################################################################
 
14
"""Content Type convenience lookup functions 
 
15
 
 
16
$Id: __init__.py 67630 2006-04-27 00:54:03Z jim $
 
17
"""
 
18
__docformat__ = 'restructuredtext'
 
19
from zope.interface import classProvides
 
20
from zope.schema.interfaces import IVocabularyFactory
 
21
from zope.app.interface import queryType
 
22
from zope.app.content.interfaces import IContentType
 
23
from zope.app.component.vocabulary import UtilityVocabulary
 
24
 
 
25
def queryContentType(object):
 
26
    """Returns the interface implemented by object which implements
 
27
    `IContentType`."""
 
28
    return queryType(object, IContentType)
 
29
 
 
30
class ContentTypesVocabulary(UtilityVocabulary):
 
31
    classProvides(IVocabularyFactory)
 
32
    interface = IContentType