I need a single column of the table in list format format
based ie select col1 where foo. Can I do this? Can I
write my own sql? Whats the most efficient way to do this?
I seem to be uncomfortable using SQLObject because some of
my tables aren't really objects as much as linking tables.
In this case we have a User who has friends so I added a
Friends class (userid,friendid) which isn't really an
object in my mind.
From: Daniel F. <fet...@go...> - 2010-07-12 23:41:51
> I need a single column of the table in list format format
> based ie select col1 where foo. Can I do this?
See http://www.mail-archive.com/sql...@li.../msg04736.html
> Can I write my own sql? Whats the most efficient way to do this?
See http://sqlobject.org/SQLBuilder.html
> I seem to be uncomfortable using SQLObject because some of
> my tables aren't really objects as much as linking tables.
> In this case we have a User who has friends so I added a
> Friends class (userid,friendid) which isn't really an
> object in my mind.
Well, a friend table is just as much a Friend object as a user table
is a User object (in my mind, at least).
Cheers,
Daniel
--
Psss, psss, put it down! - http://www.cafepress.com/putitdown
From: Frank W. <fra...@no...> - 2010-07-13 01:25:53
2010/7/13 Daniel:
>> I seem to be uncomfortable using SQLObject because some of
>> my tables aren't really objects as much as linking tables.
>> In this case we have a User who has friends so I added a
>> Friends class (userid,friendid) which isn't really an
>> object in my mind.
i think youre thinking of ForeignKeys: http://www.sqlobject.org/FAQ.html#id15
when referencing itself, you´ll have something like a user table and a
user_user table, resulting in a n times m relationship between users
(a.k.a. friends).
hth,
frank
On Mon, Jul 12, 2010 at 11:12:54PM +0000, Mark wrote:
> some of
> my tables aren't really objects as much as linking tables.
> In this case we have a User who has friends so I added a
> Friends class (userid,friendid)
It seems you want ForeignKey/MultipleJoin/RelatedJoin.
Oleg.
--
Oleg Broytman http://phd.pp.ru/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.