sqlobject question...
Matt Nordhoff
mnordhoff at mattnordhoff.com
Sat Dec 29 20:09:14 EST 2007
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.
--
More information about the Python-list
mailing list