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

Last change on this file since 5082 was 5081, checked in by uli, 15 years ago

Add interface for batch container and let access code interface derive
from IWAeUPObject.

File size: 1.5 KB
Line 
1"""Interfaces of access code related components.
2"""
3
4from zope import schema
5from zope.interface import Interface
6from waeup.sirp.interfaces import IWAeUPObject
7
8class IAccessCode(IWAeUPObject):
9    """An access code.
10    """
11    batch_serial = schema.Int(
12        title = u'Serial number inside batch',
13        )
14    batch_prefix = schema.TextLine(
15        title = u'Prefix inside batch',
16        )
17    batch_num = schema.Int(
18        title = u'Batch number',
19        )
20    random_num = schema.TextLine(
21        title = u'Random part of access code.',
22        )
23    cost = schema.Float(
24        title = u'Cost of access code',
25        )
26    invalidation_date = schema.Datetime(
27        title = u'Datetime of invalidation',
28        required = False,
29        default = None,
30        )
31    student_id = schema.TextLine(
32        title = u'Student ID or registration number',
33        required = False,
34        default = None,
35        )
36
37class IAccessCodeBatch(Interface):
38    """A factory for batches of access codes.
39    """
40    creation_date = schema.Date(
41        title = u'Creation date',
42        )
43    creator = schema.TextLine(
44        title = u'Batch creator',
45        )
46    batch_prefix = schema.TextLine(
47        title = u'Prefix inside batch',
48        )
49    batch_num = schema.Int(
50        title = u'Batch number',
51        )
52
53class IAccessCodeBatchContainer(IWAeUPObject):
54    """A container for access code batches.
55    """
56
57    def addBatch(batch):
58        """Add a batch.
59        """
Note: See TracBrowser for help on using the repository browser.