Index: pykota/trunk/pykota/storages/pgstorage.py
===================================================================
--- pykota/trunk/pykota/storages/pgstorage.py (revision 1244)
+++ pykota/trunk/pykota/storages/pgstorage.py (revision 1249)
@@ -22,4 +22,7 @@
 #
 # $Log$
+# Revision 1.27  2004/01/06 14:24:59  jalet
+# Printer groups should be cached now, if caching is enabled.
+#
 # Revision 1.26  2003/12/29 14:12:48  uid67467
 # Tries to workaround possible integrity violations when retrieving printer groups
@@ -338,4 +341,16 @@
                 groups.append(self.getGroup(record.get("groupname")))
         return groups        
+        
+    def getParentPrintersFromBackend(self, printer) :    
+        """Get all the printer groups this printer is a member of."""
+        pgroups = []
+        result = self.doSearch("SELECT groupid,printername FROM printergroupsmembers JOIN printers ON groupid=id WHERE printerid=%s;" % self.doQuote(printer.ident))
+        if result :
+            for record in result :
+                if record["groupid"] != printer.ident : # in case of integrity violation
+                    parentprinter = self.getPrinter(record.get("printername"))
+                    if parentprinter.Exists :
+                        pgroups.append(parentprinter)
+        return pgroups
         
     def getMatchingPrinters(self, printerpattern) :
@@ -398,16 +413,4 @@
         return groupsandquotas
         
-    def getParentPrinters(self, printer) :    
-        """Get all the printer groups this printer is a member of."""
-        pgroups = []
-        result = self.doSearch("SELECT groupid,printername FROM printergroupsmembers JOIN printers ON groupid=id WHERE printerid=%s;" % self.doQuote(printer.ident))
-        if result :
-            for record in result :
-                if record["groupid"] != printer.ident : # in case of integrity violation
-                    parentprinter = self.getPrinter(record.get("printername"))
-                    if parentprinter.Exists :
-                        pgroups.append(parentprinter)
-        return pgroups
-        
     def addPrinter(self, printername) :        
         """Adds a printer to the quota storage, returns it."""
Index: pykota/trunk/pykota/storages/ldapstorage.py
===================================================================
--- pykota/trunk/pykota/storages/ldapstorage.py (revision 1244)
+++ pykota/trunk/pykota/storages/ldapstorage.py (revision 1249)
@@ -22,4 +22,7 @@
 #
 # $Log$
+# Revision 1.43  2004/01/06 14:24:59  jalet
+# Printer groups should be cached now, if caching is enabled.
+#
 # Revision 1.42  2003/12/29 14:12:48  uid67467
 # Tries to workaround possible integrity violations when retrieving printer groups
@@ -499,4 +502,16 @@
         return groups        
         
+    def getParentPrintersFromBackend(self, printer) :    
+        """Get all the printer groups this printer is a member of."""
+        pgroups = []
+        result = self.doSearch("(&(objectClass=pykotaPrinter)(uniqueMember=%s))" % printer.ident, ["pykotaPrinterName"], base=self.info["printerbase"])
+        if result :
+            for (printerid, fields) in result :
+                if printerid != printer.ident : # In case of integrity violation.
+                    parentprinter = self.getPrinter(fields.get("pykotaPrinterName")[0])
+                    if parentprinter.Exists :
+                        pgroups.append(parentprinter)
+        return pgroups
+        
     def getMatchingPrinters(self, printerpattern) :
         """Returns the list of all printers for which name matches a certain pattern."""
@@ -564,16 +579,4 @@
         return groupsandquotas
         
-    def getParentPrinters(self, printer) :    
-        """Get all the printer groups this printer is a member of."""
-        pgroups = []
-        result = self.doSearch("(&(objectClass=pykotaPrinter)(uniqueMember=%s))" % printer.ident, ["pykotaPrinterName"], base=self.info["printerbase"])
-        if result :
-            for (printerid, fields) in result :
-                if printerid != printer.ident : # In case of integrity violation.
-                    parentprinter = self.getPrinter(fields.get("pykotaPrinterName")[0])
-                    if parentprinter.Exists :
-                        pgroups.append(parentprinter)
-        return pgroups
-        
     def addPrinter(self, printername) :        
         """Adds a printer to the quota storage, returns it."""
