[SQLObject] PostgreSQL and Serial, foreign keys for self-reference
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Bud P. B. <bu...@si...> - 2003-03-31 16:44:49
|
I just started a project and would like to use SQLObject. May I ask two questions: 1. Does SQLObject support self-references back to the same class, such as they occur in parent/child relationships (or hierarchies)? Can I use the foreignKey keyword argument for that? 2. While I don't have much experience in Postgresql, I read up on the CREATE SEQUENCE statement. It seems there is an easier way to do this as illustrated in the following example from http://www.postgresql.org/docs/view.php?version=7.3&idoc=1&file=datatype.html#DATATYPE-SERIAL CREATE TABLE tablename (colname SERIAL); It seems that prior to version 7.3, SERIAL implied UNIQUE. I checked in older documentation (version 6.5), and SERIAL seems to be supported even back then. Is there a reason for using SEQUENCE instead of SERIAL? many thanks for your help --bud /----------------------------------------------------------------- | Bud P. Bruegger, Ph.D. | Sistema (www.sistema.it) | Via U. Bassi, 54 | 58100 Grosseto, Italy | +39-0564-411682 (voice and fax) \----------------------------------------------------------------- |