Changeset 3139
- Timestamp:
- 01/28/07 21:53:07 (18 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/sql.py
r3133 r3139 827 827 """Deletes many billing codes.""" 828 828 codeids = ", ".join(["%s" % self.doQuote(b.ident) for b in billingcodes]) 829 self.multipleQueriesInTransaction([ 829 if codeids : 830 self.multipleQueriesInTransaction([ 830 831 "DELETE FROM billingcodes WHERE id IN (%s)" % codeids,]) 831 832 … … 833 834 """Deletes many users.""" 834 835 userids = ", ".join(["%s" % self.doQuote(u.ident) for u in users]) 835 self.multipleQueriesInTransaction([ 836 if userids : 837 self.multipleQueriesInTransaction([ 836 838 "DELETE FROM payments WHERE userid IN (%s)" % userids, 837 839 "DELETE FROM groupsmembers WHERE userid IN (%s)" % userids, … … 843 845 """Deletes many groups.""" 844 846 groupids = ", ".join(["%s" % self.doQuote(g.ident) for g in groups]) 845 self.multipleQueriesInTransaction([ 847 if groupids : 848 self.multipleQueriesInTransaction([ 846 849 "DELETE FROM groupsmembers WHERE groupid IN (%s)" % groupids, 847 850 "DELETE FROM grouppquota WHERE groupid IN (%s)" % groupids, … … 851 854 """Deletes many printers.""" 852 855 printerids = ", ".join(["%s" % self.doQuote(p.ident) for p in printers]) 853 self.multipleQueriesInTransaction([ 856 if printerids : 857 self.multipleQueriesInTransaction([ 854 858 "DELETE FROM printergroupsmembers WHERE groupid IN (%s) OR printerid IN (%s)" % (printerids, printerids), 855 859 "DELETE FROM jobhistory WHERE printerid IN (%s)" % printerids, … … 862 866 printerids = ", ".join(["%s" % self.doQuote(p.ident) for p in printers]) 863 867 userids = ", ".join(["%s" % self.doQuote(u.ident) for u in users]) 864 self.multipleQueriesInTransaction([ 868 if userids and printerids : 869 self.multipleQueriesInTransaction([ 865 870 "DELETE FROM jobhistory WHERE userid IN (%s) AND printerid IN (%s)" \ 866 871 % (userids, printerids), … … 872 877 printerids = ", ".join(["%s" % self.doQuote(p.ident) for p in printers]) 873 878 groupids = ", ".join(["%s" % self.doQuote(g.ident) for g in groups]) 874 self.multipleQueriesInTransaction([ 879 if groupids and printerids : 880 self.multipleQueriesInTransaction([ 875 881 "DELETE FROM grouppquota WHERE groupid IN (%s) AND printerid IN (%s)" \ 876 882 % (groupids, printerids),])