"""Interfaces of access code related components. """ from zope import schema from zope.interface import Interface from waeup.sirp.interfaces import IWAeUPObject class IAccessCode(IWAeUPObject): """An access code. """ batch_serial = schema.Int( title = u'Serial number inside batch', ) batch_prefix = schema.TextLine( title = u'Prefix inside batch', ) batch_num = schema.Int( title = u'Batch number', ) random_num = schema.TextLine( title = u'Random part of access code.', ) cost = schema.Float( title = u'Cost of access code', ) invalidation_date = schema.Datetime( title = u'Datetime of invalidation', required = False, default = None, ) student_id = schema.TextLine( title = u'Student ID or registration number', required = False, default = None, ) class IAccessCodeBatch(Interface): """A factory for batches of access codes. """ creation_date = schema.Date( title = u'Creation date', ) creator = schema.TextLine( title = u'Batch creator', ) batch_prefix = schema.TextLine( title = u'Prefix inside batch', ) batch_num = schema.Int( title = u'Batch number', ) class IAccessCodeBatchContainer(IWAeUPObject): """A container for access code batches. """ def addBatch(batch): """Add a batch. """