Changeset 768 for pykota/trunk/pykota/storages/sql.py
- Timestamp:
- 02/08/03 23:39:46 (21 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/sql.py
r765 r768 15 15 # 16 16 # $Log$ 17 # Revision 1.16 2003/02/08 22:39:46 jalet 18 # --reset command line option added 19 # 17 20 # Revision 1.15 2003/02/08 22:12:09 jalet 18 21 # Life time counter for users and groups added. … … 135 138 136 139 def addUserPQuota(self, username, printername) : 140 """Initializes a user print quota on a printer, adds the printer and the user to the quota storage if needed.""" 137 141 (userid, printerid) = self.getUPIds(username, printername) 138 142 if printerid is None : … … 152 156 (userid, printerid) = self.getUPIds(username, printername) 153 157 if (userid is not None) and (printerid is not None) : 154 result = self.doQuery("SELECT pagecounter, softlimit, hardlimit, datelimit FROM userpquota WHERE userid=%s AND printerid=%s;" % (self.doQuote(userid), self.doQuote(printerid)))158 result = self.doQuery("SELECT lifepagecounter, pagecounter, softlimit, hardlimit, datelimit FROM userpquota WHERE userid=%s AND printerid=%s;" % (self.doQuote(userid), self.doQuote(printerid))) 155 159 try : 156 160 return self.doParseResult(result)[0] … … 163 167 if (userid is not None) and (printerid is not None) : 164 168 self.doQuery("UPDATE userpquota SET softlimit=%s, hardlimit=%s, datelimit=NULL WHERE userid=%s AND printerid=%s;" % (self.doQuote(softlimit), self.doQuote(hardlimit), self.doQuote(userid), self.doQuote(printerid))) 169 170 def resetUserPQuota(self, username, printername) : 171 """Resets the page counter to zero. Life time page counter is kept unchanged.""" 172 (userid, printerid) = self.getUPIds(username, printername) 173 if (userid is not None) and (printerid is not None) : 174 self.doQuery("UPDATE userpquota SET pagecounter=0 WHERE userid=%s AND printerid=%s;" % (self.doQuote(userid), self.doQuote(printerid))) 165 175 166 176 def setDateLimit(self, username, printername, datelimit) :