Changeset 834 for WAeUP_SRP


Ignore:
Timestamp:
10 Nov 2006, 21:15:13 (18 years ago)
Author:
Henrik Bettermann
Message:

Notification text changed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/WAeUPTables.py

    r780 r834  
    4141        setattr(ob, key, value)
    4242    return ob
    43        
     43
    4444
    4545class WAeUPTable(ZCatalog):
    46    
     46
    4747    implements(IWAeUPTable)
    4848    security = ClassSecurityInfo()
    49        
     49
    5050    def addRecord(self, **data):
    5151        # The uid is the same as "bed".
     
    5656        self.catalog_object(dict2ob(data), uid=uid)
    5757        return uid
    58    
     58
    5959    def deleteRecord(self, uid):
    6060        #import pdb;pdb.set_trace()
    6161        self.uncatalog_object(uid)
    62    
     62
    6363    def searchAndSetRecord(self, **data):
    6464        raise NotImplemented
     
    100100        current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
    101101        open("%s/import/%s-%s.csv" % (i_home,self.getId(),current),"w+").write('\n'.join(csv))
    102        
    103            
     102
     103
    104104class AccommodationTable(WAeUPTable):
    105    
     105
    106106    meta_type = 'WAeUP Accommodation Tool'
    107107    name = "accommodation"
     
    114114        if len(records) > 0:
    115115            return -1,"Student with Id %s already booked bed %s" % (student_id,records[0].bed)
    116            
     116
    117117        records = [r for r in self.searchResults({'bed_type' : bed_type}) if not r.student]
    118118        #import pdb;pdb.set_trace()
    119119        if len(records) == 0:
    120             return -1,"no bed of this type available"
     120            return -1,"No bed of this type available"
    121121        rec = records[0]
    122122        self.modifyRecord(bed=rec.bed,student=student_id)
    123123        return 1,rec.bed
    124        
     124
    125125
    126126InitializeClass(AccommodationTable)
    127127
    128128class PinTable(WAeUPTable):
    129    
     129
    130130    meta_type = 'WAeUP Pin Tool'
    131131    name = "pins"
     
    140140        if len(records) > 0:
    141141            for r in records:
    142                 if r.pin != uid and r.prefix_batch.startswith(prefix): 
     142                if r.pin != uid and r.prefix_batch.startswith(prefix):
    143143                    return -2
    144144        records = self.searchResults({"%s" % self.key : uid})
Note: See TracChangeset for help on using the changeset viewer.