Changeset 9262 for main/waeup.kofa/trunk


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.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
3 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):
  • main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/tests/test_export.py

    r9261 r9262  
    7070            result,
    7171             'cost,creation_date,creator,disabled_num,entry_num,num,'
    72              'prefix,used_num\r\n6.6,now,manfred,0,0,1,APP,0\r\n6.6,'
    73              'now,manfred,0,0,0,SFE,0\r\n'
     72             'prefix,used_num,batch_id\r\n6.6,now,manfred,0,0,1,APP,0,APP-1\r\n'
     73             '6.6,now,manfred,0,0,0,SFE,0,SFE-0\r\n'
    7474            )
    7575        return
  • main/waeup.kofa/trunk/src/waeup/kofa/permissions.py

    r9259 r9262  
    222222
    223223class CCOfficer(grok.Role):
    224     """The Computer Center Officer gets the same permissions as the
    225     Portal Manager except the most dangerous ones.
     224    """This is basically a copy of the the PortalManager. We exclude some
     225    'dangerous' permissions by commenting them out.
    226226    """
    227227    grok.name('waeup.CCOfficer')
Note: See TracChangeset for help on using the changeset viewer.