Changeset 1051
- Timestamp:
- 06/30/03 15:54:21 (21 years ago)
- Location:
- pykota/trunk/pykota/storages
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/ldapstorage.py
r1041 r1051 21 21 # 22 22 # $Log$ 23 # Revision 1.12 2003/06/30 13:54:21 jalet 24 # Sorts by user / group name 25 # 23 26 # Revision 1.11 2003/06/25 14:10:01 jalet 24 27 # Hey, it may work (edpykota --reset excepted) ! … … 402 405 userpquota.Exists = 1 403 406 usersandquotas.append((user, userpquota)) 407 usersandquotas.sort(lambda x, y : cmp(x[0].Name, y[0].Name)) 404 408 return usersandquotas 405 409 … … 414 418 grouppquota = self.getGroupPQuota(group, printer) 415 419 groupsandquotas.append((group, grouppquota)) 420 groupsandquotas.sort(lambda x, y : cmp(x[0].Name, y[0].Name)) 416 421 return groupsandquotas 417 422 -
pykota/trunk/pykota/storages/pgstorage.py
r1041 r1051 21 21 # 22 22 # $Log$ 23 # Revision 1.4 2003/06/30 13:54:21 jalet 24 # Sorts by user / group name 25 # 23 26 # Revision 1.3 2003/06/25 14:10:01 jalet 24 27 # Hey, it may work (edpykota --reset excepted) ! … … 270 273 """Returns the list of users who uses a given printer, along with their quotas.""" 271 274 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)) 273 276 if result : 274 277 for record in result : … … 294 297 """Returns the list of groups which uses a given printer, along with their quotas.""" 295 298 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)) 297 300 if result : 298 301 for record in result :