Show
Ignore:
Timestamp:
04/16/03 10:53:14 (21 years ago)
Author:
jalet
Message:

Printing can now be limited either by user's account balance or by
page quota (the default). Quota report doesn't include account balance
yet, though.

Files:
1 modified

Legend:

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

    r921 r925  
    2121# 
    2222# $Log$ 
     23# Revision 1.26  2003/04/16 08:53:14  jalet 
     24# Printing can now be limited either by user's account balance or by 
     25# page quota (the default). Quota report doesn't include account balance 
     26# yet, though. 
     27# 
    2328# Revision 1.25  2003/04/15 21:58:33  jalet 
    2429# edpykota now accepts a --delete option. 
     
    234239            return 
    235240         
     241    def getUserLimitBy(self, userid) :     
     242        """Returns the way in which user printing is limited.""" 
     243        result = self.doQuery("SELECT limitby FROM users WHERE id=%s" % self.doQuote(userid)) 
     244        try : 
     245            return self.doParseResult(result)[0]["limitby"] 
     246        except TypeError :      # Not found     
     247            return 
     248         
     249    def getGroupLimitBy(self, groupid) :     
     250        """Returns the way in which group printing is limited.""" 
     251        result = self.doQuery("SELECT limitby FROM groups WHERE id=%s" % self.doQuote(groupid)) 
     252        try : 
     253            return self.doParseResult(result)[0]["limitby"] 
     254        except TypeError :      # Not found     
     255            return 
     256         
    236257    def setUserBalance(self, userid, balance) :     
    237258        """Sets the account balance for a given user to a fixed value."""