Show
Ignore:
Timestamp:
02/11/06 11:47:29 (18 years ago)
Author:
jerome
Message:

Ensures that date based filtering works consistently between LDAP and SQL.
Doesn't set an empty date to the other date anymore, because this gave
unexpected results :
dumpykota --data history start=20060101
gave only the history for 20060101 and not the history from
this date to the current date, as probably most people would
have expected. This is now fixed.

Files:
1 modified

Legend:

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

    r2657 r2665  
    130130            thefilter = "AND %s" % thefilter 
    131131        (startdate, enddate) = self.cleanDates(startdate, enddate) 
    132         if startdate and enddate :  
    133             thefilter = "%s AND jobdate>=%s AND jobdate<=%s" % (thefilter, self.doQuote(startdate), self.doQuote(enddate)) 
     132        if startdate :  
     133            thefilter = "%s AND jobdate>=%s" % (thefilter, self.doQuote(startdate)) 
     134        if enddate :  
     135            thefilter = "%s AND jobdate<=%s" % (thefilter, self.doQuote(enddate)) 
    134136        result = self.doRawSearch("SELECT users.username,printers.printername,jobhistory.* FROM users,printers,jobhistory WHERE users.id=jobhistory.userid AND printers.id=jobhistory.printerid %s ORDER BY jobhistory.id ASC" % thefilter) 
    135137        return self.prepareRawResult(result)