[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: sqlobject question...

Matt Nordhoff

12/30/2007 1:09:00 AM

bruce wrote:
> hi...
>
> this continues my investigation of python/sqlobject, as it relates to the
> need to have an id, which is auto-generated.
>
> per various sites/docs on sqlobject, it appears that you can override the
> id, by doing something similar to the following:
>
> def foo(SQLObject):
> def _init(self, id, connection=None):
> id = str(id)
> SQLObject._init(self, id, connection)
>
> cat=StringCol()
> dog=StringCol()
>
>
> however, no matter what i do, i can't seem to insert anything into "id" so
> that i can use the "id"!!!!
>
> any thoughts/comments/pointers, code samples would be helpful!!!
>
> thanks

SQLObject may do something weird, but normally the init method is named
"__init__", not "_init". Try changing that.
--