Changeset 1522 for pykota/trunk/pykota/storage.py
- Timestamp:
- 06/06/04 00:03:50 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storage.py
r1520 r1522 22 22 # 23 23 # $Log$ 24 # Revision 1.54 2004/06/05 22:03:49 jalet 25 # Payments history is now stored in database 26 # 24 27 # Revision 1.53 2004/06/03 23:14:10 jalet 25 28 # Now stores the job's size in bytes in the database. … … 230 233 self.LifeTimePaid = None 231 234 self.Email = None 235 self.Payments = [] # TODO : maybe handle this smartly for SQL, for now just don't retrieve them 232 236 233 237 def consumeAccountBalance(self, amount) : … … 238 242 def setAccountBalance(self, balance, lifetimepaid) : 239 243 """Sets the user's account balance in case he pays more money.""" 240 self.parent.writeUserAccountBalance(self, balance, lifetimepaid) 241 self.AccountBalance = balance 242 self.LifeTimePaid = lifetimepaid 244 diff = float(lifetimepaid or 0.0) - float(self.LifeTimePaid or 0.0) 245 self.parent.beginTransaction() 246 try : 247 self.parent.writeUserAccountBalance(self, balance, lifetimepaid) 248 self.parent.writeNewPayment(self, diff) 249 except PyKotaStorageError, msg : 250 self.parent.rollbackTransaction() 251 raise PyKotaStorageError, msg 252 else : 253 self.parent.commitTransaction() 254 self.AccountBalance = balance 255 self.LifeTimePaid = lifetimepaid 243 256 244 257 def setLimitBy(self, limitby) :