Ignore:
Timestamp:
3 Apr 2010, 14:10:12 (15 years ago)
Author:
uli
Message:

Implement completely different design for access-codes and their batches. We drop using zope.catalogs here and care
for the limited set of operations we need on access codes and batches ourselves. This speeds up performance for batch
creation by factor 2 and uses only half the memory in ZODB than what was needed with old PIN implemenentation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/browser_templates/batchcontainer.pt

    r5103 r5118  
    44  The following batches are available:
    55</p>
    6 <table>
    7   <thead>
    8     <tr>
    9       <th>Prefix</th><th>Entries/(invalidated)</th><th>Cost</th>
    10       <th>Created</th><th>Creator</th>
    11     </tr>
    12   </thead>
    13   <tbody>
    14     <tr tal:repeat="batch context/values"
    15         tal:attributes="class python: repeat['batch'].odd() and 'even' or 'odd'">
    16       <td>
    17         <span tal:replace="batch/prefix">APP</span>
    18         -
    19         <span tal:replace="batch/num">10</span>
    20       </td>
    21       <td>
    22         <span tal:replace="batch/entry_num">1012</span>
    23         /
    24         <span tal:replace="python: view.invalidated(batch)">512</span>
    25       </td>
    26       <td tal:content="batch/cost">12.12</td>
    27       <td tal:content="python: batch.creation_date.ctime()">2009/12/24</td>
    28       <td tal:content="batch/creator">some user</td>
    29     </tr>
    30     <tr tal:condition="not: context/values">
    31       <td colspan="5"><b>No batches yet</b></td>
    32     </tr>
    33   </tbody>
    34 </table>
     6<form method="POST">
     7  <table>
     8    <thead>
     9      <tr>
     10        <th>&nbsp;</th>
     11        <th>Prefix</th><th>Entries/(invalidated)</th><th>Cost</th>
     12        <th>Created</th><th>Creator</th>
     13      </tr>
     14    </thead>
     15    <tbody>
     16      <tr tal:repeat="batch context/values"
     17          tal:attributes="class python: repeat['batch'].odd() and 'even' or 'odd'">
     18        <td>
     19          <input type="checkbox" name="batches" value="batch/prefix"
     20                 tal:attributes="value batch/__name__" />
     21        </td>
     22        <td>
     23          <span tal:replace="batch/prefix">APP</span>
     24          -
     25          <span tal:replace="batch/num">10</span>
     26        </td>
     27        <td>
     28          <span tal:replace="batch/entry_num">1012</span>
     29          /
     30          <span tal:replace="batch/invalidated_num">512</span>
     31        </td>
     32        <td tal:content="batch/cost">12.12</td>
     33        <td tal:content="python: batch.creation_date.ctime()">2009/12/24</td>
     34        <td tal:content="batch/creator">some user</td>
     35      </tr>
     36      <tr tal:condition="not: context/values">
     37        <td colspan="5"><b>No batches yet</b></td>
     38      </tr>
     39    </tbody>
     40  </table>
     41  <input type="submit" name="archive" value="Archive" />
     42  <input type="submit" name="delete" value="Archive and Delete" />
     43</form>
Note: See TracChangeset for help on using the changeset viewer.