Mercurial > p > roundup > code
diff roundup/backends/rdbms_common.py @ 3016:224c7c0b9708
First checkin of tsearch2 "backend". Miscellaneous notes:
* We override the testTransactions method, as it relies on FileStorage for its
transaction testing.
* importing/exporting doesn't work right yet.
* Filtering of text/plain mime-types is an ugly hack right now.
| author | Johannes Gijsbers <jlgijsbers@users.sourceforge.net> |
|---|---|
| date | Thu, 16 Dec 2004 22:22:55 +0000 |
| parents | 693069ac2039 |
| children | b77961cdb9a0 |
line wrap: on
line diff
--- a/roundup/backends/rdbms_common.py Wed Dec 15 00:00:52 2004 +0000 +++ b/roundup/backends/rdbms_common.py Thu Dec 16 22:22:55 2004 +0000 @@ -1,4 +1,4 @@ -# $Id: rdbms_common.py,v 1.142 2004-12-03 22:11:06 richard Exp $ +# $Id: rdbms_common.py,v 1.143 2004-12-16 22:22:55 jlgijsbers Exp $ ''' Relational database (SQL) backend common code. Basics: @@ -454,14 +454,21 @@ return 1 + def determine_all_columns(self, spec): + """Figure out the columns from the spec and also add internal columns + + """ + cols, mls = self.determine_columns(spec.properties.items()) + + # add on our special columns + cols.append(('id', 'INTEGER PRIMARY KEY')) + cols.append(('__retired__', 'INTEGER DEFAULT 0')) + return cols, mls + def create_class_table(self, spec): '''Create the class table for the given Class "spec". Creates the indexes too.''' - cols, mls = self.determine_columns(spec.properties.items()) - - # add on our special columns - cols.append(('id', 'INTEGER PRIMARY KEY')) - cols.append(('__retired__', 'INTEGER DEFAULT 0')) + cols, mls = self.determine_all_columns(spec) # create the base table scols = ','.join(['%s %s'%x for x in cols])
