Mercurial > p > roundup > code
comparison roundup/hyperdb.py @ 282:fb1b67a8fd98
Reverted a change in hyperdb...
...so the default value for missing property values in a create() is
None and not '' (the empty string.) This obviously breaks CSV
import/export - the string 'None' will be created in an export/import
operation.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 11 Oct 2001 00:17:51 +0000 |
| parents | a5dabf2430c5 |
| children | 49be38bb6e9a |
comparison
equal
deleted
inserted
replaced
| 281:d38ca22f7a2f | 282:fb1b67a8fd98 |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 # $Id: hyperdb.py,v 1.24 2001-10-10 03:54:57 richard Exp $ | 18 # $Id: hyperdb.py,v 1.25 2001-10-11 00:17:51 richard Exp $ |
| 19 | 19 |
| 20 # standard python modules | 20 # standard python modules |
| 21 import cPickle, re, string | 21 import cPickle, re, string |
| 22 | 22 |
| 23 # roundup modules | 23 # roundup modules |
| 213 if key == self.key: | 213 if key == self.key: |
| 214 raise ValueError, 'key property "%s" is required'%key | 214 raise ValueError, 'key property "%s" is required'%key |
| 215 if isinstance(prop, Multilink): | 215 if isinstance(prop, Multilink): |
| 216 propvalues[key] = [] | 216 propvalues[key] = [] |
| 217 else: | 217 else: |
| 218 propvalues[key] = '' | 218 propvalues[key] = None |
| 219 | 219 |
| 220 # convert all data to strings | 220 # convert all data to strings |
| 221 for key, prop in self.properties.items(): | 221 for key, prop in self.properties.items(): |
| 222 if isinstance(prop, Date): | 222 if isinstance(prop, Date): |
| 223 propvalues[key] = propvalues[key].get_tuple() | 223 propvalues[key] = propvalues[key].get_tuple() |
| 847 cl.create(name=option[i], order=i) | 847 cl.create(name=option[i], order=i) |
| 848 return hyperdb.Link(name) | 848 return hyperdb.Link(name) |
| 849 | 849 |
| 850 # | 850 # |
| 851 # $Log: not supported by cvs2svn $ | 851 # $Log: not supported by cvs2svn $ |
| 852 # Revision 1.24 2001/10/10 03:54:57 richard | |
| 853 # Added database importing and exporting through CSV files. | |
| 854 # Uses the csv module from object-craft for exporting if it's available. | |
| 855 # Requires the csv module for importing. | |
| 856 # | |
| 852 # Revision 1.23 2001/10/09 23:58:10 richard | 857 # Revision 1.23 2001/10/09 23:58:10 richard |
| 853 # Moved the data stringification up into the hyperdb.Class class' get, set | 858 # Moved the data stringification up into the hyperdb.Class class' get, set |
| 854 # and create methods. This means that the data is also stringified for the | 859 # and create methods. This means that the data is also stringified for the |
| 855 # journal call, and removes duplication of code from the backends. The | 860 # journal call, and removes duplication of code from the backends. The |
| 856 # backend code now only sees strings. | 861 # backend code now only sees strings. |
