Modify ↓
#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)
Note: See
TracTickets for help on using
tickets.



(In [796]) * use the
Milestonemodel API to be cross-DB compatible and preserve proper sorting (fixes #158, #213, #235, #398)Markupto make sure HTML is properly escaped for output