Ticket #213 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

[PATCH] 0.9 doesnt work as is

Reported by: tyardley Assigned to: 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

Change History

05/31/06 06:24:54 changed by mgood

  • status changed from new to closed.
  • resolution set to fixed.

(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

Add/Change #213 ([PATCH] 0.9 doesnt work as is)




Change Properties
Action