Show
Ignore:
Timestamp:
04/15/03 15:55:28 (21 years ago)
Author:
jalet
Message:

Options --limitby and --balance added to edpykota

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/sql.py

    r915 r917  
    2121# 
    2222# $Log$ 
     23# Revision 1.24  2003/04/15 13:55:28  jalet 
     24# Options --limitby and --balance added to edpykota 
     25# 
    2326# Revision 1.23  2003/04/15 11:30:57  jalet 
    2427# More work done on money print charging. 
     
    232235        self.increaseUserBalance(userid, difference) 
    233236         
    234     def limitUserByQuota(self, userid) :     
    235         """Limits a given user based on print quota.""" 
    236         self.doQuery("UPDATE users SET limitby='quota' WHERE id=%s" % self.doQuote(userid)) 
    237          
    238     def limitUserByBalance(self, userid) :     
    239         """Limits a given user based on account balance.""" 
    240         self.doQuery("UPDATE users SET limitby='balance' WHERE id=%s" % self.doQuote(userid)) 
     237    def limitUserBy(self, userid, limitby) :     
     238        """Limits a given user based either on print quota or on account balance.""" 
     239        self.doQuery("UPDATE users SET limitby=%s WHERE id=%s" % (self.doQuote(limitby), self.doQuote(userid))) 
     240         
     241    def limitGroupBy(self, groupid, limitby) :     
     242        """Limits a given group based either on print quota or on sum of its users' account balances.""" 
     243        self.doQuery("UPDATE groups SET limitby=%s WHERE id=%s" % (self.doQuote(limitby), self.doQuote(groupid))) 
    241244         
    242245    def setUserPQuota(self, userid, printerid, softlimit, hardlimit) :