Ignore:
Timestamp:
1 Oct 2012, 06:36:33 (12 years ago)
Author:
Henrik Bettermann
Message:

We need to export the batch id. This is necessary for reimport batches.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/export.py

    r9261 r9262  
    3333
    3434    #: Fieldnames considered by this exporter
    35     fields = tuple(sorted(iface_names(IAccessCodeBatch)))
     35    fields = tuple(sorted(iface_names(IAccessCodeBatch))) + ('batch_id',)
    3636
    3737    #: The title under which this exporter will be displayed
    3838    title = _(u'AccessCodeBatches')
     39
     40    def mangle_value(self, value, name, context=None):
     41        if name == 'batch_id' and context is not None:
     42            value = u'%s-%s' % (getattr(context, 'prefix', None),
     43                getattr(context, 'num', None))
     44        return super(
     45            AccessCodeBatchExporter, self).mangle_value(
     46            value, name, context=context)
    3947
    4048    def export_all(self, site, filepath=None):
Note: See TracChangeset for help on using the changeset viewer.