Changeset 1120 for WAeUP_SRP/trunk/ScratchCards.py
- Timestamp:
- 21 Dec 2006, 21:37:26 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/ScratchCards.py
r1082 r1120 137 137 % (doc.prefix,doc.batch_no), 138 138 )[-max_pins:] if not p.student] 139 ## used = [{'pin': p.pin,140 ## 'serial': p.serial,141 ## 'student': p.student,142 ## } for p in pins_cat.searchResults(prefix_batch = "%s%d"143 ## % (doc.prefix,doc.batch_no),144 ## ) if p.student]145 ## if len (unused) <= max_pins:146 ## return unused,used147 139 return unused 140 141 security.declareProtected(View,"getUsedPins") 142 def getUsedPins(self): 143 """return a list of used Pins""" 144 #import pdb;pdb.set_trace() 145 pins_cat = self.portal_pins 146 doc = self.getContent() 147 used = [{'pin': p.pin, 148 'prefix_batch': p.prefix_batch, 149 'serial': p.serial, 150 'student': p.student, 151 } for p in pins_cat.searchResults(prefix_batch = "%s%d" 152 % (doc.prefix,doc.batch_no), 153 ) if p.student] 154 return used 148 155 149 156 security.declareProtected(View,"getNumberOfUsedPins")
Note: See TracChangeset for help on using the changeset viewer.