Changeset 1277 for pykota/trunk/pykota/storages/pgstorage.py
- Timestamp:
- 01/12/04 16:12:50 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/pgstorage.py
r1275 r1277 22 22 # 23 23 # $Log$ 24 # Revision 1.34 2004/01/12 15:12:50 jalet 25 # Small fix for history 26 # 24 27 # Revision 1.33 2004/01/12 14:44:47 jalet 25 28 # Missing space in SQL query … … 541 544 def retrieveHistory(self, user=None, printer=None, datelimit=None, limit=100) : 542 545 """Retrieves all print jobs for user on printer (or all) before date, limited to first 100 results.""" 543 query = "SELECT * FROM jobhistory"546 query = "SELECT jobhistory.*,username,printername FROM jobhistory,users,printers WHERE users.id=userid AND printers.id=printerid" 544 547 where = [] 545 548 if (user is not None) and user.Exists : … … 550 553 where.append("jobdate<=%s" % self.doQuote(datelimit)) 551 554 if where : 552 query += " WHERE%s" % " AND ".join(where)555 query += " AND %s" % " AND ".join(where) 553 556 query += " ORDER BY id DESC" 554 557 if limit : … … 570 573 job.JobOptions = fields.get("options") 571 574 job.JobDate = fields.get("jobdate") 572 job.User = self.getUser(fields.get("user id"))573 job.Printer = self.getPrinter(fields.get("printer id"))575 job.User = self.getUser(fields.get("username")) 576 job.Printer = self.getPrinter(fields.get("printername")) 574 577 job.Exists = 1 575 578 jobs.append(job)