comparison 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
comparison
equal deleted inserted replaced
2639:75d410d11a20 2640:b01eca163779
1 # $Id: rdbms_common.py,v 1.125 2004-07-27 01:18:25 richard Exp $ 1 # $Id: rdbms_common.py,v 1.126 2004-07-27 04:28:39 richard Exp $
2 ''' Relational database (SQL) backend common code. 2 ''' Relational database (SQL) backend common code.
3 3
4 Basics: 4 Basics:
5 5
6 - map roundup classes to relational tables 6 - map roundup classes to relational tables
2560 2560
2561 # do content? 2561 # do content?
2562 if content: 2562 if content:
2563 # store and index 2563 # store and index
2564 self.db.storefile(self.classname, itemid, None, content) 2564 self.db.storefile(self.classname, itemid, None, content)
2565 mime_type = propvalues.get('type', self.get(itemid, 'type')) 2565 if self.getprops().has_key('type'):
2566 if not mime_type: 2566 mime_type = propvalues.get('type', self.get(itemid, 'type',
2567 self.default_mime_type))
2568 else:
2567 mime_type = self.default_mime_type 2569 mime_type = self.default_mime_type
2568 self.db.indexer.add_text((self.classname, itemid, 'content'), 2570 self.db.indexer.add_text((self.classname, itemid, 'content'),
2569 content, mime_type) 2571 content, mime_type)
2572
2573 propvalues['content'] = content
2570 2574
2571 # fire reactors 2575 # fire reactors
2572 self.fireReactors('set', itemid, oldvalues) 2576 self.fireReactors('set', itemid, oldvalues)
2573 return propvalues 2577 return propvalues
2574 2578

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