Changeset 1330 for pykota/trunk/pykota/storages
- Timestamp:
- 02/04/04 12:17:00 (20 years ago)
- Location:
- pykota/trunk/pykota/storages
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/ldapstorage.py
r1320 r1330 22 22 # 23 23 # $Log$ 24 # Revision 1.50 2004/02/04 11:17:00 jalet 25 # pkprinters command line tool added. 26 # 24 27 # Revision 1.49 2004/01/29 22:35:45 jalet 25 28 # Small fix from Matt. … … 974 977 else : 975 978 self.doDelete(group.ident) 976 979 980 def deletePrinter(self, printer) : 981 """Completely deletes an user from the Quota Storage.""" 982 result = self.doSearch("(&(objectClass=pykotaLastJob)(pykotaPrinterName=%s))" % printer.Name, base=self.info["lastjobbase"]) 983 for (ident, fields) in result : 984 self.doDelete(ident) 985 result = self.doSearch("(&(objectClass=pykotaJob)(pykotaPrinterName=%s))" % printer.Name, base=self.info["jobbase"]) 986 for (ident, fields) in result : 987 self.doDelete(ident) 988 result = self.doSearch("(&(objectClass=pykotaGroupPQuota)(pykotaPrinterName=%s))" % printer.Name, base=self.info["groupquotabase"]) 989 for (ident, fields) in result : 990 self.doDelete(ident) 991 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaPrinterName=%s))" % printer.Name, base=self.info["userquotabase"]) 992 for (ident, fields) in result : 993 self.doDelete(ident) 994 for parent in self.getParentPrinters(printer) : 995 parent.uniqueMember.remove(printer.ident) 996 fields = { 997 "uniqueMember" : parent.uniqueMember, 998 } 999 self.doModify(parent.ident, fields) 1000 self.doDelete(printer.ident) -
pykota/trunk/pykota/storages/sql.py
r1327 r1330 22 22 # 23 23 # $Log$ 24 # Revision 1.35 2004/02/04 11:17:00 jalet 25 # pkprinters command line tool added. 26 # 24 27 # Revision 1.34 2004/02/02 22:44:16 jalet 25 28 # Preliminary work on Relationnal Database Independance via DB-API 2.0 … … 408 411 ] : 409 412 self.doModify(q) 410 413 414 def deletePrinter(self, printer) : 415 """Completely deletes a printer from the Quota Storage.""" 416 for q in [ 417 "DELETE FROM printergroupsmembers WHERE groupid=%s OR printerid=%s" % (self.doQuote(printer.ident), self.doQuote(printer.ident)), 418 "DELETE FROM jobhistory WHERE printerid=%s" % self.doQuote(printer.ident), 419 "DELETE FROM grouppquota WHERE printerid=%s" % self.doQuote(printer.ident), 420 "DELETE FROM userpquota WHERE printerid=%s" % self.doQuote(printer.ident), 421 "DELETE FROM printers WHERE id=%s" % self.doQuote(printer.ident), 422 ] : 423 self.doModify(q) 424