[SQLObject] Re: Hi guys. Please, I need help
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: fingerclick <fc...@bo...> - 2004-04-23 22:13:21
|
Scott Russell wrote:
> You need to let SQLobject do the work. :)
>
> class Login(SQLObject):
> firstName = StringCol()
> middleInitial = StringCol(length=1, default=None)
> lastName = StringCol()
>
> class db_request(SQLObject):
> new_file = IntCol(default=1)
> DbRequest = ForeignKey('Login')
> DbSource = ForeignKey('Login')
>
> ... snip ...
>
> r1 = db_request.new(new_file=1, DbRequest=p1, DbSource=p2 )
>
> Notice all I did was remove "Id" from the end of your column names.
> Fields ending in _id are special items to SQLobject. Besides, you
> didn't want to reference the id - you wanted to reference the object.
> Let SO worry about the IDs, unless you're doing something especially
> tricky.
>
> I also flipped the BoolCol to an IntCol because I've never used it and I
> couldn't figure out how to. :) (Is BoolCol a postgres-only column?)
>
> - Scott
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
Thanks to much man for all help. :) Now i´m stating to inderstand he way
SQLObject works, and i think it´s my right choice.
|