Changeset 490 for WAeUP_SRP


Ignore:
Timestamp:
7 Sep 2006, 13:30:36 (18 years ago)
Author:
joachim
Message:

A trunk/skins/waeup_student/widget_scratch_card_pin_render.pt
M trunk/WAeUPTables.py
M trunk/ScratchCards.py

Location:
WAeUP_SRP/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/ScratchCards.py

    r489 r490  
    4545    security = ClassSecurityInfo()
    4646
    47     def __init__(self,**kw):
     47    def __init__(self,id,**kw):
     48        CPSDocument.__init__(self,id,**kw)
    4849        self.table = PinTable()
    49         CPSDocument.__init__(self, kw)
    5050       
    5151    security.declareProtected(View,"Title")
     
    6565        for i in range(nr):
    6666            pin = "%d%d" % (b_no,r.randint(999999999,1000000000))
    67             while  self.table.searchResults(uid=pin):
    68                 pin = "%d%d" % (b_no,r.randint(999999999,1000000000))
    69             table.addRecord(pin=pin,serial=i,student="")
     67            import pdp;pdb.set_trace()
     68            while len(res) > 0:
     69                pin = "%d%d" % (b_no,r.randint(9999,1000000000))
     70                res = self.table.searchResults(uid=pin)
     71            self.table.addRecord(pin=pin,serial=i,student="")
    7072            print i,pin
    7173
  • WAeUP_SRP/trunk/WAeUPTables.py

    r440 r490  
    8686    def addRecord(self, **data):
    8787        # The uid is the same as "bed".
    88         uid = data['bed']
     88        uid = data['pin']
    8989        self.catalog_object(dict2ob(data), uid=uid)
    9090        return uid
Note: See TracChangeset for help on using the changeset viewer.