Changeset 1711 for pykota/trunk/pykota/storages/sql.py
- Timestamp:
- 09/10/04 23:32:54 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/sql.py
r1582 r1711 22 22 # 23 23 # $Log$ 24 # Revision 1.44 2004/09/10 21:32:54 jalet 25 # Small fixes for incomplete entry intialization 26 # 24 27 # Revision 1.43 2004/07/01 17:45:49 jalet 25 28 # Added code to handle the description field for printers … … 286 289 def addUser(self, user) : 287 290 """Adds a user to the quota storage, returns its id.""" 288 self.doModify("INSERT INTO users (username, limitby, balance, lifetimepaid, email) VALUES (%s, %s, %s, %s, %s)" % (self.doQuote(user.Name), self.doQuote(user.LimitBy ), self.doQuote(user.AccountBalance), self.doQuote(user.LifeTimePaid), self.doQuote(user.Email)))291 self.doModify("INSERT INTO users (username, limitby, balance, lifetimepaid, email) VALUES (%s, %s, %s, %s, %s)" % (self.doQuote(user.Name), self.doQuote(user.LimitBy or 'quota'), self.doQuote(user.AccountBalance or 0.0), self.doQuote(user.LifeTimePaid or 0.0), self.doQuote(user.Email))) 289 292 return self.getUser(user.Name) 290 293 291 294 def addGroup(self, group) : 292 295 """Adds a group to the quota storage, returns its id.""" 293 self.doModify("INSERT INTO groups (groupname, limitby) VALUES (%s, %s)" % (self.doQuote(group.Name), self.doQuote(group.LimitBy )))296 self.doModify("INSERT INTO groups (groupname, limitby) VALUES (%s, %s)" % (self.doQuote(group.Name), self.doQuote(group.LimitBy or "quota"))) 294 297 return self.getGroup(group.Name) 295 298