Mercurial > p > roundup > code
comparison roundup/backends/rdbms_common.py @ 1528:96cd422532ef
bye bye gadfly - you served your purpose well [SF#701127]
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 18 Mar 2003 00:50:24 +0000 |
| parents | 63aa7be52d2c |
| children | 800b5896e14a |
comparison
equal
deleted
inserted
replaced
| 1525:c006e8166f81 | 1528:96cd422532ef |
|---|---|
| 1 # $Id: rdbms_common.py,v 1.45 2003-03-17 22:03:08 kedder Exp $ | 1 # $Id: rdbms_common.py,v 1.46 2003-03-18 00:50:24 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 |
| 16 | 16 |
| 17 Database-specific changes may generally be pushed out to the overridable | 17 Database-specific changes may generally be pushed out to the overridable |
| 18 sql_* methods, since everything else should be fairly generic. There's | 18 sql_* methods, since everything else should be fairly generic. There's |
| 19 probably a bit of work to be done if a database is used that actually | 19 probably a bit of work to be done if a database is used that actually |
| 20 honors column typing, since the initial databases don't (sqlite stores | 20 honors column typing, since the initial databases don't (sqlite stores |
| 21 everything as a string, and gadfly stores anything that's marsallable). | 21 everything as a string.) |
| 22 ''' | 22 ''' |
| 23 | 23 |
| 24 # standard python modules | 24 # standard python modules |
| 25 import sys, os, time, re, errno, weakref, copy | 25 import sys, os, time, re, errno, weakref, copy |
| 26 | 26 |
| 431 self.cursor.execute(sql, vals) | 431 self.cursor.execute(sql, vals) |
| 432 | 432 |
| 433 # | 433 # |
| 434 # Nodes | 434 # Nodes |
| 435 # | 435 # |
| 436 | |
| 437 def addnode(self, classname, nodeid, node): | 436 def addnode(self, classname, nodeid, node): |
| 438 ''' Add the specified node to its class's db. | 437 ''' Add the specified node to its class's db. |
| 439 ''' | 438 ''' |
| 440 if __debug__: | 439 if __debug__: |
| 441 print >>hyperdb.DEBUG, 'addnode', (self, classname, nodeid, node) | 440 print >>hyperdb.DEBUG, 'addnode', (self, classname, nodeid, node) |
| 442 # gadfly requires values for all non-multilink columns | 441 |
| 442 # determine the column definitions and multilink tables | |
| 443 cl = self.classes[classname] | 443 cl = self.classes[classname] |
| 444 cols, mls = self.determine_columns(cl.properties.items()) | 444 cols, mls = self.determine_columns(cl.properties.items()) |
| 445 | 445 |
| 446 # we'll be supplied these props if we're doing an import | 446 # we'll be supplied these props if we're doing an import |
| 447 if not node.has_key('creator'): | 447 if not node.has_key('creator'): |
