src/pyams_sequence/interfaces/__init__.py
changeset 96 e9b0a0f92960
parent 65 7a5bb2cb45d2
equal deleted inserted replaced
95:e9b102805b94 96:e9b0a0f92960
     8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
    10 # FOR A PARTICULAR PURPOSE.
    10 # FOR A PARTICULAR PURPOSE.
    11 #
    11 #
    12 
    12 
    13 __docformat__ = 'restructuredtext'
    13 from zope.annotation.interfaces import IAttributeAnnotatable
       
    14 from zope.interface import Attribute, Interface
       
    15 from zope.schema import Int, TextLine
       
    16 
       
    17 from pyams_sequence.schema import InternalReferenceField, InternalReferencesListField
    14 
    18 
    15 
    19 
    16 # import standard library
    20 __docformat__ = 'restructuredtext'
    17 
       
    18 # import interfaces
       
    19 from pyams_sequence.schema import InternalReferenceField, InternalReferencesListField
       
    20 from zope.annotation.interfaces import IAttributeAnnotatable
       
    21 
       
    22 # import packages
       
    23 from zope.interface import Interface, Attribute
       
    24 from zope.schema import TextLine, Int
       
    25 
    21 
    26 from pyams_sequence import _
    22 from pyams_sequence import _
    27 
    23 
    28 
    24 
    29 class ISequentialIntIds(Interface):
    25 class ISequentialIntIds(Interface):
    88 
    84 
    89 class ISequentialIdTarget(IAttributeAnnotatable):
    85 class ISequentialIdTarget(IAttributeAnnotatable):
    90     """Marker interface used to identify contents requiring sequential IDs"""
    86     """Marker interface used to identify contents requiring sequential IDs"""
    91 
    87 
    92     sequence_name = TextLine(title=_("Sequence name"),
    88     sequence_name = TextLine(title=_("Sequence name"),
    93                              description=_("Name of registered sequence utility used to get unique IDs"),
    89                              description=_("Name of registered sequence utility used to get "
       
    90                                            "unique IDs"),
    94                              required=False)
    91                              required=False)
    95 
    92 
    96     sequence_prefix = TextLine(title=_("Hexadecimal prefix"),
    93     sequence_prefix = TextLine(title=_("Hexadecimal prefix"),
    97                                description=_("Prefix used to generate hexadecimal ID, placed after utility prefix. "
    94                                description=_("Prefix used to generate hexadecimal ID, placed "
    98                                              "Generally defined at class level..."),
    95                                              "after utility prefix. Generally defined at class "
       
    96                                              "level..."),
    99                                required=False)
    97                                required=False)
   100 
    98 
   101 
    99 
   102 class IInternalReference(IAttributeAnnotatable):
   100 class IInternalReference(IAttributeAnnotatable):
   103     """Internal link interface"""
   101     """Internal link interface"""
   104 
   102 
   105     reference = InternalReferenceField(title=_("Internal reference"),
   103     reference = InternalReferenceField(title=_("Internal reference"),
   106                                        description=_("Internal link target reference. You can search a reference using "
   104                                        description=_("Internal link target reference. You can "
   107                                                      "'+' followed by internal number, of by entering text matching "
   105                                                      "search a reference using '+' followed by "
   108                                                      "content title."),
   106                                                      "internal number, of by entering text "
       
   107                                                      "matching content title."),
   109                                        required=True)
   108                                        required=True)
   110 
   109 
   111     target = Attribute("Internal reference target")
   110     target = Attribute("Internal reference target")
   112 
   111 
   113     def get_target(self, state=None, request=None):
   112     def get_target(self, state=None, request=None):