Changeset 12

Show
Ignore:
Timestamp:
08/06/05 22:29:15 (7 years ago)
Author:
mj
Message:

Not prefixes and sources, but key domains. Better term all round. Also expand the domain interface with more UI info.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/chronolog/interfaces.py

    r11 r12  
    2424 
    2525    Every ITimeLogEntry is stored keyed on a set of ITimeLogKey. Keys are  
    26     unique for a given prefix and id; the prefix denotes the source from 
     26    unique for a given domain and id; the domain denotes the source from 
    2727    which they where obtained. 
    2828 
    2929    """ 
    30     prefix = TextLine( 
    31         title=u'Prefix', 
    32         description=u'The source identifier of the key.', 
     30    domain = TextLine( 
     31        title=u'Domain', 
     32        description=u'The id of the domain this key is part of.', 
    3333        readonly=True, 
    3434        required=True) 
     
    5454 
    5555 
    56 class ITimeLogKeySource(Interface): 
    57     """A source of keys 
    58      
    59     For any given key prefix only one source can be used. 
    60      
    61     """ 
    62     prefix = TextLine( 
    63         title=u'Prefix', 
    64         description=u'The source identifier of the key.', 
    65         required=True) 
     56class ITimeLogKeyDomain(Interface): 
     57    """A key domain 
     58     
     59    A key domain is the source where keys are obtained, like principals or 
     60    projects. 
     61     
     62    """ 
     63    id = TextLine( 
     64        title=u'Id', 
     65        description=u'The identifier of the domain.', 
     66        required=True) 
     67     
     68    title = TextLine( 
     69        title=u'Title', 
     70        description=u'The domain title for UI display', 
     71        required=False) 
     72     
     73    description = Text( 
     74        title=u'Description', 
     75        description=u'A detailed description of the domain.', 
     76        required=False) 
    6677     
    6778    def getKey(id): 
     
    7384        """ 
    7485    def listKeys(): 
    75         """Return an iterable of all keys in this source""" 
    76  
    77  
    78 class ITimeLogKeySourcesCollection(IEnumerableMapping): 
    79     """A collection of ITimeLogKeySources 
    80  
    81     ITimeLogKeySources are keyed on their prefixes. 
     86        """Return an iterable of all keys in this domain""" 
     87 
     88 
     89class ITimeLogKeyDomainsCollection(IEnumerableMapping): 
     90    """A collection of ITimeLogKeyDomians 
     91 
     92    ITimeLogKeyDomains are keyed on their id. 
    8293     
    8394    """