Mercurial > p > roundup > code
diff roundup/backends/rdbms_common.py @ 2640:b01eca163779
The "type" parameter is supposed to be optional
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 27 Jul 2004 04:28:39 +0000 |
| parents | f47ca4541770 |
| children | 1df7d4a41da4 |
line wrap: on
line diff
--- a/roundup/backends/rdbms_common.py Tue Jul 27 02:34:14 2004 +0000 +++ b/roundup/backends/rdbms_common.py Tue Jul 27 04:28:39 2004 +0000 @@ -1,4 +1,4 @@ -# $Id: rdbms_common.py,v 1.125 2004-07-27 01:18:25 richard Exp $ +# $Id: rdbms_common.py,v 1.126 2004-07-27 04:28:39 richard Exp $ ''' Relational database (SQL) backend common code. Basics: @@ -2562,12 +2562,16 @@ if content: # store and index self.db.storefile(self.classname, itemid, None, content) - mime_type = propvalues.get('type', self.get(itemid, 'type')) - if not mime_type: + if self.getprops().has_key('type'): + mime_type = propvalues.get('type', self.get(itemid, 'type', + self.default_mime_type)) + else: mime_type = self.default_mime_type self.db.indexer.add_text((self.classname, itemid, 'content'), content, mime_type) + propvalues['content'] = content + # fire reactors self.fireReactors('set', itemid, oldvalues) return propvalues
