Changeset 2717 for pykota/trunk/pykota/storages
- Timestamp:
- 02/20/06 22:12:24 (18 years ago)
- Location:
- pykota/trunk/pykota/storages
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/ldapstorage.py
r2707 r2717 1405 1405 self.doDelete(group.ident) 1406 1406 1407 def deleteUserPQuota(self, upquota) : 1408 """Completely deletes an user print quota entry from the database.""" 1409 uname = self.userCharsetToDatabase(upquota.User.Name) 1410 pname = self.userCharsetToDatabase(upquota.Printer.Name) 1411 result = self.doSearch("(&(objectClass=pykotaJob)(pykotaUserName=%s)(pykotaPrinterName=%s))" \ 1412 % (uname, pname), \ 1413 base=self.info["jobbase"]) 1414 for (ident, fields) in result : 1415 self.doDelete(ident) 1416 self.doDelete(upquota.ident) 1417 1418 def deleteGroupPQuota(self, gpquota) : 1419 """Completely deletes a group print quota entry from the database.""" 1420 self.doDelete(gpquota.ident) 1421 1407 1422 def deletePrinter(self, printer) : 1408 1423 """Completely deletes a printer from the Quota Storage.""" -
pykota/trunk/pykota/storages/sql.py
r2707 r2717 729 729 730 730 def deleteUser(self, user) : 731 """Completely deletes an user from the Quota Storage."""731 """Completely deletes an user from the database.""" 732 732 # TODO : What should we do if we delete the last person who used a given printer ? 733 733 # TODO : we can't reassign the last job to the previous one, because next user would be … … 741 741 ] : 742 742 self.doModify(q) 743 744 def deleteUserPQuota(self, upquota) : 745 """Completely deletes an user print quota entry from the database.""" 746 for q in [ 747 "DELETE FROM jobhistory WHERE userid=%s" % self.doQuote(upquota.User.ident), 748 "DELETE FROM userpquota WHERE userid=%s" % self.doQuote(upquota.ident), 749 ] : 750 self.doModify(q) 751 752 def deleteGroupPQuota(self, gpquota) : 753 """Completely deletes a group print quota entry from the database.""" 754 for q in [ 755 "DELETE FROM grouppquota WHERE groupid=%s" % self.doQuote(gpquota.ident), 756 ] : 757 self.doModify(q) 743 758 744 759 def deleteGroup(self, group) : 745 """Completely deletes a group from the Quota Storage."""760 """Completely deletes a group from the database.""" 746 761 for q in [ 747 762 "DELETE FROM groupsmembers WHERE groupid=%s" % self.doQuote(group.ident), … … 752 767 753 768 def deletePrinter(self, printer) : 754 """Completely deletes a printer from the Quota Storage."""769 """Completely deletes a printer from the database.""" 755 770 for q in [ 756 771 "DELETE FROM printergroupsmembers WHERE groupid=%s OR printerid=%s" % (self.doQuote(printer.ident), self.doQuote(printer.ident)), … … 763 778 764 779 def deleteBillingCode(self, code) : 765 """Completely deletes a billing code from the Quota Storage."""780 """Completely deletes a billing code from the database.""" 766 781 for q in [ 767 782 "DELETE FROM billingcodes WHERE id=%s" % self.doQuote(code.ident),