On Thursday 31 July 2003 14:02, Sidnei da Silva wrote:
> On Thu, Jul 31, 2003 at 11:45:50AM +0200, Luc Stepniewski wrote:
> | 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)
> Its a bug yes. The solution is to find out what class
> 'nextval('public.societe_soc_id_seq'::text)' is (humm... I should put
> that in the error message) and register a converter to it. There are
> lots of examples in SQLBuilder.py and Converters.py, but I couldnt
> catch all the possible classes that would slipt through the sqlRepr
> function. I just added SQLObjectField yesterday, and a few more, but I
> didn't added Field for example as I couldn't see where it could be used.
But why does it work if I don't define the _idName attribute? Isn't there
another problem with the use of that attribute which may not be accounted
when looking for the primary key?
I've looked at Converters.py. I don't understand the way the information is
identified. When I look at it, it seems the information is identified only by
its basic types.
I added an output of obj.__class__ in sqlRepr() in Converters.py to see the
class name. The problem is that I get 'SQLObject.SQLBuilder.SQLConstant'.
What am I supposed to do this it?
SQLObject don't seem to support Bool postgreSQL type, so I looked at what was
returned by sqlRepr() when trying to interpret Bool keyword: it returns the
same thing: SQLObject.SQLBuilder.SQLConstant
Luc Stepniewski <lstep@...> <http://lstep.free.fr/>
Adelux - Securite, Linux Public key: <http://lstep.free.fr/pubkey.txt>
Key BC0E3C2A fingerprint = A4FA466C68D27E46B427 07D083ED6340BC0E3C2A