On Sat, Dec 20, 2008 at 1:58 PM, Sean DiZazzo <[email protected]> wrote:
>
> Ok.  Dropping down to raw sql query gets me my results, however the
> tuple returned doesn't work with my datagrid widget.  Is there any way
> to coerce the tuple to a sqlobject.sresults.SelectResult object?  Or
> to run the raw query so that it returns the SelectResults object?
>
> files = model.Files._connection.queryAll("""SELECT files.* FROM files
> INNER JOIN (SELECT MAX(id) AS id FROM files GROUP BY filename) ids ON
> files.id = ids.id""")
>

By raw you mean dbapi? you will have to do several things to turn it
back into an "object" the first thing is that not all drivers support
datetime objects, the most notable exception is SQLite, so you will
have to convert that back. The second is that the TG widget was build
to use a SQLObject object, so you will have to find a way (I have
never done that) to build an instances out of the returned result set.

Also as Diez suggested you should go to the SQLObject, mailing list,
Oleg will have an answer to both your questions. He just doesn't reads
this list.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to