src/pyams_content/site/__init__.py
changeset 0 7c0001cacf8e
equal deleted inserted replaced
-1:000000000000 0:7c0001cacf8e
       
     1 #
       
     2 # Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
       
     3 # All Rights Reserved.
       
     4 #
       
     5 # This software is subject to the provisions of the Zope Public License,
       
     6 # Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
       
     7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
       
     8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
       
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
       
    10 # FOR A PARTICULAR PURPOSE.
       
    11 #
       
    12 
       
    13 __docformat__ = 'restructuredtext'
       
    14 
       
    15 
       
    16 # import standard library
       
    17 
       
    18 # import interfaces
       
    19 from pyams_content.site.interfaces import ISite
       
    20 from zope.schema.interfaces import IVocabularyFactory
       
    21 
       
    22 # import packages
       
    23 from pyams_utils.container import BTreeOrderedContainer
       
    24 from zope.componentvocabulary.vocabulary import UtilityVocabulary
       
    25 from zope.interface import provider, implementer
       
    26 from zope.schema.vocabulary import getVocabularyRegistry
       
    27 
       
    28 
       
    29 @implementer(ISite)
       
    30 class Site(BTreeOrderedContainer):
       
    31     """Site persistent class"""
       
    32 
       
    33 
       
    34 @provider(IVocabularyFactory)
       
    35 class SiteVocabulary(UtilityVocabulary):
       
    36     """Sites vocabulary"""
       
    37 
       
    38     interface = ISite
       
    39     nameOnly = True
       
    40 
       
    41 getVocabularyRegistry().register('PyAMS content sites', SiteVocabulary)