| 504 | def getParentPrintersFromBackend(self, printer) : |
| 505 | """Get all the printer groups this printer is a member of.""" |
| 506 | pgroups = [] |
| 507 | result = self.doSearch("(&(objectClass=pykotaPrinter)(uniqueMember=%s))" % printer.ident, ["pykotaPrinterName"], base=self.info["printerbase"]) |
| 508 | if result : |
| 509 | for (printerid, fields) in result : |
| 510 | if printerid != printer.ident : # In case of integrity violation. |
| 511 | parentprinter = self.getPrinter(fields.get("pykotaPrinterName")[0]) |
| 512 | if parentprinter.Exists : |
| 513 | pgroups.append(parentprinter) |
| 514 | return pgroups |
| 515 | |
566 | | def getParentPrinters(self, printer) : |
567 | | """Get all the printer groups this printer is a member of.""" |
568 | | pgroups = [] |
569 | | result = self.doSearch("(&(objectClass=pykotaPrinter)(uniqueMember=%s))" % printer.ident, ["pykotaPrinterName"], base=self.info["printerbase"]) |
570 | | if result : |
571 | | for (printerid, fields) in result : |
572 | | if printerid != printer.ident : # In case of integrity violation. |
573 | | parentprinter = self.getPrinter(fields.get("pykotaPrinterName")[0]) |
574 | | if parentprinter.Exists : |
575 | | pgroups.append(parentprinter) |
576 | | return pgroups |
577 | | |