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

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

Add first accesscode (former PIN) data models.

File size: 1.3 KB
Line 
1"""Interfaces of access code related components.
2"""
3
4from zope import schema
5from zope.interface import Interface
6
7class IAccessCode(Interface):
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',
24        )
25    invalidation_date = schema.Datetime(
26        title = u'Datetime of invalidation',
27        required = False,
28        default = None,
29        )
30    student_id = schema.TextLine(
31        title = u'Student ID or registration number',
32        required = False,
33        default = None,
34        )
35
36class IAccessCodeBatch(Interface):
37    """A factory for batches of access codes.
38    """
39    creation_date = schema.Date(
40        title = u'Creation date',
41        )
42    creator = schema.TextLine(
43        title = u'Batch creator',
44        )
45    batch_prefix = schema.TextLine(
46        title = u'Prefix inside batch',
47        )
48    batch_num = schema.Int(
49        title = u'Batch number',
50        )
51
52    def __iter__():
53        """Iterate over all access codes in this batch.
54        """
Note: See TracBrowser for help on using the repository browser.