changeset 1753:9d7c396defe1 maint-0.5

backporting fix from HEAD
author Richard Jones <richard@users.sourceforge.net>
date Tue, 26 Aug 2003 00:15:09 +0000
parents 311375e4f2fe
children 707b0c09ba8b
files CHANGES.txt roundup/backends/back_anydbm.py roundup/backends/back_metakit.py roundup/backends/rdbms_common.py
diffstat 4 files changed, 60 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Fri Jul 18 07:05:56 2003 +0000
+++ b/CHANGES.txt	Tue Aug 26 00:15:09 2003 +0000
@@ -1,6 +1,10 @@
 This file contains the changes to the Roundup system over time. The entries
 are given with the most recent entry first.
 
+2003-??-?? 0.5.10
+- backported importing bugfixes from HEAD
+
+
 2003-07-18 0.5.9
 - backported XSS message cleaning fix (sf bug 757128)
 - only clean sessions once per hour (backport from trunk)
--- a/roundup/backends/back_anydbm.py	Fri Jul 18 07:05:56 2003 +0000
+++ b/roundup/backends/back_anydbm.py	Tue Aug 26 00:15:09 2003 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-#$Id: back_anydbm.py,v 1.96.2.3 2003-03-10 00:22:52 richard Exp $
+#$Id: back_anydbm.py,v 1.96.2.4 2003-08-26 00:15:09 richard Exp $
 '''
 This module defines a backend that saves the hyperdatabase in a database
 chosen by anydbm. It is guaranteed to always be available in python
@@ -942,7 +942,7 @@
                 newid = value
                 continue
             elif value is None:
-                # don't set Nones
+                d[propname] = None
                 continue
             elif isinstance(prop, hyperdb.Date):
                 value = date.Date(value)
--- a/roundup/backends/back_metakit.py	Fri Jul 18 07:05:56 2003 +0000
+++ b/roundup/backends/back_metakit.py	Tue Aug 26 00:15:09 2003 +0000
@@ -1,3 +1,34 @@
+# $Id: back_metakit.py,v 1.30.2.3 2003-08-26 00:15:09 richard Exp $
+'''
+   Metakit backend for Roundup, originally by Gordon McMillan.
+
+   Notes by Richard:
+
+   This backend has some behaviour specific to metakit:
+
+    - there's no concept of an explicit "unset" in metakit, so all types
+      have some "unset" value:
+
+      ========= ===== ====================================================
+      Type      Value Action when fetching from mk
+      ========= ===== ====================================================
+      Strings   ''    convert to None
+      Date      0     (seconds since 1970-01-01.00:00:00) convert to None
+      Interval  ''    convert to None
+      Number    0     ambiguious :( - do nothing
+      Boolean   0     ambiguious :( - do nothing
+      Link      0     convert to None
+      Multilink []    actually, mk can handle this one ;)
+      Passowrd  ''    convert to None
+      ========= ===== ====================================================
+
+      The get/set routines handle these values accordingly by converting
+      to/from None where they can. The Number/Boolean types are not able
+      to handle an "unset" at all, so they default the "unset" to 0.
+
+    - probably a bunch of stuff that I'm not aware of yet because I haven't
+      fully read through the source. One of these days....
+'''
 from roundup import hyperdb, date, password, roundupdb, security
 import metakit
 from sessions import Sessions
@@ -1011,9 +1042,18 @@
             propname = propnames[i]
             prop = properties[propname]
             if propname == 'id':
-                newid = value
-                value = int(value)
-            elif isinstance(prop, hyperdb.Date):
+                newid = value = int(value)
+            elif propname == 'is retired':
+                # is the item retired?
+                if int(value):
+                    d['_isdel'] = 1
+                continue
+            elif value is None:
+                d[propname] = None
+                continue
+
+            prop = properties[propname]
+            if isinstance(prop, hyperdb.Date):
                 value = int(calendar.timegm(value))
             elif isinstance(prop, hyperdb.Interval):
                 value = str(date.Interval(value))
--- a/roundup/backends/rdbms_common.py	Fri Jul 18 07:05:56 2003 +0000
+++ b/roundup/backends/rdbms_common.py	Tue Aug 26 00:15:09 2003 +0000
@@ -1,4 +1,4 @@
-# $Id: rdbms_common.py,v 1.27.2.9 2003-06-24 08:18:19 anthonybaxter Exp $
+# $Id: rdbms_common.py,v 1.27.2.10 2003-08-26 00:15:09 richard Exp $
 ''' Relational database (SQL) backend common code.
 
 Basics:
@@ -1124,7 +1124,17 @@
             if propname == 'id':
                 newid = value
                 continue
+            elif propname == 'is retired':
+                # is the item retired?
+                if int(value):
+                    retire = 1
+                continue
             elif value is None:
+                d[propname] = None
+                continue
+
+            prop = properties[propname]
+            if value is None:
                 # don't set Nones
                 continue
             elif isinstance(prop, hyperdb.Date):

Roundup Issue Tracker: http://roundup-tracker.org/