Changeset 1051

Show
Ignore:
Timestamp:
06/30/03 15:54:21 (21 years ago)
Author:
jalet
Message:

Sorts by user / group name

Location:
pykota/trunk/pykota/storages
Files:
2 modified

Legend:

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

    r1041 r1051  
    2121# 
    2222# $Log$ 
     23# Revision 1.12  2003/06/30 13:54:21  jalet 
     24# Sorts by user / group name 
     25# 
    2326# Revision 1.11  2003/06/25 14:10:01  jalet 
    2427# Hey, it may work (edpykota --reset excepted) ! 
     
    402405                    userpquota.Exists = 1 
    403406                    usersandquotas.append((user, userpquota)) 
     407        usersandquotas.sort(lambda x, y : cmp(x[0].Name, y[0].Name))             
    404408        return usersandquotas 
    405409                 
     
    414418                    grouppquota = self.getGroupPQuota(group, printer) 
    415419                    groupsandquotas.append((group, grouppquota)) 
     420        groupsandquotas.sort(lambda x, y : cmp(x[0].Name, y[0].Name))             
    416421        return groupsandquotas 
    417422         
  • pykota/trunk/pykota/storages/pgstorage.py

    r1041 r1051  
    2121# 
    2222# $Log$ 
     23# Revision 1.4  2003/06/30 13:54:21  jalet 
     24# Sorts by user / group name 
     25# 
    2326# Revision 1.3  2003/06/25 14:10:01  jalet 
    2427# Hey, it may work (edpykota --reset excepted) ! 
     
    270273        """Returns the list of users who uses a given printer, along with their quotas.""" 
    271274        usersandquotas = [] 
    272         result = self.doSearch("SELECT users.id as uid,username,balance,lifetimepaid,limitby,userpquota.id,lifepagecounter,pagecounter,softlimit,hardlimit,datelimit FROM users JOIN userpquota ON users.id=userpquota.userid AND printerid=%s" % self.doQuote(printer.ident)) 
     275        result = self.doSearch("SELECT users.id as uid,username,balance,lifetimepaid,limitby,userpquota.id,lifepagecounter,pagecounter,softlimit,hardlimit,datelimit FROM users JOIN userpquota ON users.id=userpquota.userid AND printerid=%s ORDER BY username ASC" % self.doQuote(printer.ident)) 
    273276        if result : 
    274277            for record in result : 
     
    294297        """Returns the list of groups which uses a given printer, along with their quotas.""" 
    295298        groupsandquotas = [] 
    296         result = self.doSearch("SELECT groupname FROM groups JOIN grouppquota ON groups.id=grouppquota.groupid AND printerid=%s" % self.doQuote(printer.ident)) 
     299        result = self.doSearch("SELECT groupname FROM groups JOIN grouppquota ON groups.id=grouppquota.groupid AND printerid=%s ORDER BY groupname ASC" % self.doQuote(printer.ident)) 
    297300        if result : 
    298301            for record in result :