On Apr 22, 2008, at 4:21 PM, Oleg Broytmann wrote:

> On Tue, Apr 22, 2008 at 04:16:53PM -0700, Fred C wrote:
>> How
>> can I have sqlobject returning the fields from both tables.
>
>   SQLObject.select() cannot do that because it doesn't know the
> description of the fields. Article.select(...) - SQLObject knows only
> Article's fields.
>   sqlbuilder.Select() returns whatever you want.


The problem with sqlbuilder is that it only know about the database  
raw fields and what is returned are just arrays of fields and I am  
loosing the mapping with the objects. In my class Articles and  
Comments I have methods  and these methods are not accessible by what  
is returned from sqlbuilder.Select

for exemple in the class Comment I have the method

     def _get_datetime(self):
         return self._SO_get_created().strftime('%b %d, %Y @ %H:%M')

This method cannot called from a request build with sqlbuilder.Select  
and can be called from a regular select

x = Comment.select()
x[0].datetime

-fred-


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to