source: main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/interfaces.py @ 6423

Last change on this file since 6423 was 6423, checked in by uli, 14 years ago

Support accessing the history for an access code via the access code itself.

File size: 1.9 KB
RevLine 
[5068]1"""Interfaces of access code related components.
2"""
3from zope import schema
4from zope.interface import Interface
[5081]5from waeup.sirp.interfaces import IWAeUPObject
[5068]6
[5081]7class IAccessCode(IWAeUPObject):
[5068]8    """An access code.
9    """
10    batch_serial = schema.Int(
11        title = u'Serial number inside batch',
12        )
13    batch_prefix = schema.TextLine(
14        title = u'Prefix inside batch',
15        )
16    batch_num = schema.Int(
17        title = u'Batch number',
18        )
19    random_num = schema.TextLine(
20        title = u'Random part of access code.',
21        )
22    cost = schema.Float(
23        title = u'Cost of access code',
[5085]24        default = 0.0, min = 0.0,
[5068]25        )
[6419]26    disabled = schema.Bool(
27        title = u'Access code is disabled',
28        default = False,
29        readonly = True,
[5068]30        )
[6419]31    used = schema.Bool(
32        title = u'Access code is already in use.',
33        default = False,
34        readonly = True,
[5068]35        )
[5098]36    representation = schema.TextLine(
37        title = u'Complete title of access code',
38        )
[6423]39    history = schema.Text(
40        title = u'The history of access code as lines',
41        default = u'',
42        readonly = True,
43       )
[6413]44
[5068]45class IAccessCodeBatch(Interface):
46    """A factory for batches of access codes.
47    """
48    creation_date = schema.Date(
49        title = u'Creation date',
50        )
51    creator = schema.TextLine(
52        title = u'Batch creator',
53        )
[6415]54    prefix = schema.TextLine(
[5085]55        title = u'Batch prefix',
[5068]56        )
[6415]57    num = schema.Int(
[5085]58        title = u'Batch number (1-3 digits)',
59        min = 0, max = 999,
[5068]60        )
[5085]61    entry_num = schema.Int(
62        title = u'Number of access codes',
63        default = 1000, min = 1,
64        )
65    cost = schema.Float(
66        title = u'Cost of access code',
67        default = 0.0, min = 0.0,
68        )
[5081]69
70class IAccessCodeBatchContainer(IWAeUPObject):
71    """A container for access code batches.
72    """
73
74    def addBatch(batch):
75        """Add a batch.
76        """
Note: See TracBrowser for help on using the repository browser.