Changeset 9260


Ignore:
Timestamp:
30 Sep 2012, 20:28:32 (12 years ago)
Author:
Henrik Bettermann
Message:

Archive also the owner of an accesscode.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes
Files:
3 edited

Legend:

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

    r8389 r9260  
    257257            )
    258258        writer = csv.writer(open(csv_path, 'w'), quoting=csv.QUOTE_ALL)
    259         writer.writerow(['prefix', 'serial', 'ac', 'state', 'history', 'cost'])
     259        writer.writerow(['prefix', 'serial', 'ac', 'state', 'history',
     260            'cost','owner'])
    260261        writer.writerow([self.prefix, '%0.2f' % self.cost, str(self.num),
    261262                         str(self.entry_num)])
     
    266267            writer.writerow([
    267268                    self.prefix, value.batch_serial, value.representation,
    268                     value.state, value.history, value.cost
     269                    value.state, value.history, value.cost, value.owner
    269270                    ])
    270271        return os.path.basename(csv_path)
  • main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/browser.txt

    r8321 r9260  
    438438    ...                             sorted(os.listdir(ac_storage))[-2])
    439439    >>> print open(archive_file, 'rb').read()
    440     "prefix","serial","ac","state","history","cost"
     440    "prefix","serial","ac","state","history","cost","owner"
    441441    "BLA","19.12","1","3"
    442     "BLA","0","BLA-1-<10-DIGITS>","initialized","...","19.12"
    443     "BLA","1","BLA-1-<10-DIGITS>","initialized","...","19.12"
    444     "BLA","2","BLA-1-<10-DIGITS>","initialized","...","19.12"
     442    "BLA","0","BLA-1-<10-DIGITS>","initialized","...","19.12",""
     443    "BLA","1","BLA-1-<10-DIGITS>","initialized","...","19.12",""
     444    "BLA","2","BLA-1-<10-DIGITS>","initialized","...","19.12",""
    445445
    446446Clean up:
  • main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/tests/test_accesscode.py

    r8321 r9260  
    301301        result_path = os.path.join(batch._getStoragePath(), basename)
    302302        expected = '''
    303 "prefix","serial","ac","state","history","cost"
     303"prefix","serial","ac","state","history","cost","owner"
    304304"FOO","9.99","1","0"
    305 "FOO","0","FOO-1-11111111","used","<YYYY-MM-DD hh:mm:ss> UTC - ...","2345.0"
     305"FOO","0","FOO-1-11111111","used","<YYYY-MM-DD hh:mm:ss> UTC - ...","2345.0",""
    306306"FOO","1","FOO-1-22222222","initialized","<YYYY-MM-DD hh:mm:ss> UTC - ...",""
    307307"FOO","2","FOO-1-33333333","disabled","<YYYY-MM-DD hh:mm:ss> UTC - ...",""
Note: See TracChangeset for help on using the changeset viewer.