Changeset 1240 for pykota/trunk/pykota/storages/pgstorage.py
- Timestamp:
- 12/27/03 17:49:25 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/pgstorage.py
r1228 r1240 22 22 # 23 23 # $Log$ 24 # Revision 1.25 2003/12/27 16:49:25 uid67467 25 # Should be ok now. 26 # 24 27 # Revision 1.24 2003/11/29 22:02:14 jalet 25 28 # Don't try to retrieve the user print quota information if current printer … … 392 395 return groupsandquotas 393 396 397 def getParentPrinters(self, printer) : 398 """Get all the printer groups this printer is a member of.""" 399 pgroups = [] 400 result = self.doSearch("SELECT printername FROM printergroupsmembers JOIN printers ON groupid=id WHERE printerid=%s;" % self.doQuote(printer.ident)) 401 if result : 402 for record in result : 403 parentprinter = self.getPrinter(record.get("printername")) 404 if parentprinter.Exists : 405 pgroups.append(parentprinter) 406 return pgroups 407 394 408 def addPrinter(self, printername) : 395 409 """Adds a printer to the quota storage, returns it.""" … … 468 482 self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action, jobsize, jobprice, filename, title, copies, options) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" % (self.doQuote(user.ident), self.doQuote(printer.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(jobsize), self.doQuote(jobprice), self.doQuote(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options))) 469 483 else : 470 self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action, filename, title, copies, options) VALUES (%s, %s, %s, %s, %s )" % (self.doQuote(user.ident), self.doQuote(printer.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options)))484 self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action, filename, title, copies, options) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)" % (self.doQuote(user.ident), self.doQuote(printer.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options))) 471 485 else : 472 486 # here we explicitly want to reset jobsize to NULL if needed