Hello,
I tried (on PostgreSQL 7.3.3) to use the _fromDatabase=True feature to be able
to use my already created tables (manually created, not with SQLObject).
SQObject chokes on the parsing of the primary key (which is a serial defined
type):
ValueError: Unknown SQL builtin type: <type 'instance'> for
nextval('public.societe_soc_id_seq'::text)
The content of my DB:
db => \d societe
Table "public.societe"
Colonne | Type | Modifications
--------------+----------------------+-------------------------------------------------------------
soc_id | integer | not null default
nextval('public.societe_soc_id_seq'::text)
soc_nom | character varying(200) |
Index: societe_pkey primary key btree (soc_id)
The code to access it:
======================
class societe(SQLObject):
_connection = conn
_fromDatabase = True
_idName = 'soc_id'
p = societe.new(socNom='Adelux', socMail='co...@ad...',
socWeb='http://www.adelux.fr')
======================
What's strange is that *if* I set a simple primary key as 'id' in my table
(the default that is looked for in SQLObject I guess), it works. It's as if
the '_idName' attribute didn't work and wasn't taken into account...
Is this a bug?
Thanks,
Luc Stepniewski
--
Luc Stepniewski <ls...@ad...> <http://lstep.free.fr/>
Adelux - Securite, Linux Public key: <http://lstep.free.fr/pubkey.txt>
Key BC0E3C2A fingerprint = A4FA466C68D27E46B427 07D083ED6340BC0E3C2A
|