- Timestamp:
- 03/01/06 15:42:33 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/sql.py
r2768 r2771 825 825 self.doModify(q) 826 826 827 def deleteInTransaction(self, queries) :828 """Does many deletions in a single transaction."""827 def multipleQueriesInTransaction(self, queries) : 828 """Does many modifications in a single transaction.""" 829 829 self.beginTransaction() 830 830 try : … … 840 840 """Deletes many billing codes.""" 841 841 codeids = ", ".join(["%s" % self.doQuote(b.ident) for b in billingcodes]) 842 self. deleteInTransaction([842 self.multipleQueriesInTransaction([ 843 843 "DELETE FROM billingcodes WHERE id IN (%s)" % codeids,]) 844 844 … … 846 846 """Deletes many users.""" 847 847 userids = ", ".join(["%s" % self.doQuote(u.ident) for u in users]) 848 self. deleteInTransaction([848 self.multipleQueriesInTransaction([ 849 849 "DELETE FROM payments WHERE userid IN (%s)" % userids, 850 850 "DELETE FROM groupsmembers WHERE userid IN (%s)" % userids, … … 856 856 """Deletes many groups.""" 857 857 groupids = ", ".join(["%s" % self.doQuote(g.ident) for g in groups]) 858 self. deleteInTransaction([858 self.multipleQueriesInTransaction([ 859 859 "DELETE FROM groupsmembers WHERE groupid IN (%s)" % groupids, 860 860 "DELETE FROM grouppquota WHERE groupid IN (%s)" % groupids, … … 864 864 """Deletes many printers.""" 865 865 printerids = ", ".join(["%s" % self.doQuote(p.ident) for p in printers]) 866 self. deleteInTransaction([866 self.multipleQueriesInTransaction([ 867 867 "DELETE FROM printergroupsmembers WHERE groupid IN (%s) OR printerid IN (%s)" % (printerids, printerids), 868 868 "DELETE FROM jobhistory WHERE printerid IN (%s)" % printerids, … … 875 875 printerids = ", ".join(["%s" % self.doQuote(p.ident) for p in printers]) 876 876 userids = ", ".join(["%s" % self.doQuote(u.ident) for u in users]) 877 self. deleteInTransaction([877 self.multipleQueriesInTransaction([ 878 878 "DELETE FROM jobhistory WHERE userid IN (%s) AND printerid IN (%s)" \ 879 879 % (userids, printerids), … … 885 885 printerids = ", ".join(["%s" % self.doQuote(p.ident) for p in printers]) 886 886 groupids = ", ".join(["%s" % self.doQuote(g.ident) for g in groups]) 887 self. deleteInTransaction([887 self.multipleQueriesInTransaction([ 888 888 "DELETE FROM grouppquota WHERE groupid IN (%s) AND printerid IN (%s)" \ 889 889 % (groupids, printerids),])