Changeset 2384

Show
Ignore:
Timestamp:
07/25/05 18:43:18 (19 years ago)
Author:
jerome
Message:

Finished (I think, but still untested) the LDAP layer to completely manage billing codes.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/ldapstorage.py

    r2380 r2384  
    14261426        return codes         
    14271427         
    1428 # def setBillingCodeValues(self, code, newbalance, newpagecounter) :     
    1429 # def consumeBillingCode(self, code, balance, pagecounter) : 
     1428    def setBillingCodeValues(self, code, newbalance, newpagecounter) :     
     1429        """Sets the new page counter and balance for a billing code.""" 
     1430        fields = { 
     1431                   "pykotaPageCounter" : str(newpagecounter), 
     1432                   "pykotaBalance" : str(newbalance), 
     1433                 }   
     1434        return self.doModify(code.ident, fields)          
     1435        
     1436    def consumeBillingCode(self, code, balance, pagecounter) : 
     1437        """Consumes from a billing code.""" 
     1438        fields = { 
     1439                   "pykotaBalance" : { "operator" : "-", "value" : balance, "convert" : float }, 
     1440                   "pykotaPageCounter" : { "operator" : "+", "value" : pagecounter, "convert" : int }, 
     1441                 } 
     1442        return self.doModify(code.ident, fields)          
    14301443