Ignore:
Timestamp:
8 Dec 2006, 12:34:33 (18 years ago)
Author:
joachim
Message:

=clearance_edit_form fixed, nr_of used Pins is shown in batch_view

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/ScratchCards.py

    r1002 r1012  
    147147        return unused
    148148
     149    security.declareProtected(View,"getNumberOfUsedPins")
     150    def getNumberOfUsedPins(self):
     151        """return the number of used Pins"""
     152        #import pdb;pdb.set_trace()
     153        pins_cat = self.portal_pins
     154        doc = self.getContent()
     155        used = [{'pin': p.pin,
     156              'serial': p.serial,
     157              'student': p.student,
     158              } for p in pins_cat.searchResults(prefix_batch = "%s%d"
     159                                               % (doc.prefix,doc.batch_no),
     160                                               ) if p.student]
     161        return len(used)
     162
    149163InitializeClass(ScratchCardBatch)
    150164
Note: See TracChangeset for help on using the changeset viewer.