Modify

Opened 19 years ago

Closed 18 years ago

Last modified 18 years ago

#213 closed defect (fixed)

[PATCH] 0.9 doesnt work as is

Reported by: tyardley Owned by: jornh
Priority: normal Component: PlannedMilestonesMacro
Severity: normal Keywords:
Cc: Trac Release:

Description

IFNULL doesnt exist in postgres, so that errors. This way is more portable I believe. Also, the method used to fetch rows returns a tuple.. so that has been corrected as well.

--- PlannedMilestones.py.orig   2006-03-09 18:40:39.000000000 -0600
+++ PlannedMilestones.py        2006-03-09 18:37:17.000000000 -0600
@@ -10,7 +10,7 @@
     query = "SELECT name, due, description FROM milestone " \
             "WHERE name != '' " \
             "AND (due IS NULL OR due = 0 OR due > %d) " \
-            "ORDER BY (IFNULL(due, 0) = 0) ASC, due ASC, name" % time()
+            "ORDER BY (due IS NULL) ASC, due ASC, name" % time()

     cursor = db.cursor()
     cursor.execute(query)
@@ -19,9 +19,9 @@
         row = cursor.fetchone()
         if not row:
             break
-        name = row['name']
-        if row['due'] > 0:
-            date = strftime('%x', localtime(row['due']))
+        name = row[0]
+        if row[1] > 0:
+            date = strftime('%x', localtime(row[1]))
         else:
             date = "<i>(later)</i>"
         if name == "":

Attachments (0)

Change History (1)

comment:1 Changed 18 years ago by Matt Good

Resolution: fixed
Status: newclosed

(In [796]) * use the Milestone model API to be cross-DB compatible and preserve proper sorting (fixes #158, #213, #235, #398)

  • use Markup to make sure HTML is properly escaped for output

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain jornh.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.