On Tue, May 18, 2004 at 06:16:10PM -0400, Eduardo Elgueta wrote:
> >>> from SQLObject import *
> >>> __connection__ = MySQLConnection(name = 'system_conn', user =
> 'user', passwd = 'pass', host = 'host', db = 'db', debug = True)
> >>> class SysUser (SQLObject):
> ... name = StringCol(length=10, alternateID=True)
> ...
> >>> u = SysUser.get(1)
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> AttributeError: type object 'SysUser' has no attribute 'get'
>
> How can I load an existing instance?
>>> u = SysUser(1) # just so simple ;)
or, using your alternateID:
>>> u = SysUser.byName("Eduardo")
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|