Show
Ignore:
Timestamp:
12/27/03 17:49:25 (20 years ago)
Author:
uid67467
Message:

Should be ok now.

Files:
1 modified

Legend:

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

    r1228 r1240  
    2222# 
    2323# $Log$ 
     24# Revision 1.25  2003/12/27 16:49:25  uid67467 
     25# Should be ok now. 
     26# 
    2427# Revision 1.24  2003/11/29 22:02:14  jalet 
    2528# Don't try to retrieve the user print quota information if current printer 
     
    392395        return groupsandquotas 
    393396         
     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         
    394408    def addPrinter(self, printername) :         
    395409        """Adds a printer to the quota storage, returns it.""" 
     
    468482                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))) 
    469483            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))) 
    471485        else :         
    472486            # here we explicitly want to reset jobsize to NULL if needed