[orm-devel] Re: Postgres & Views
Thu, 21 Nov 2002 14:46:30 +0100
>result = ds.query("select * from v_sessions") certainly is a viable option
>for me and maybe for all users. Its not as nice as having a handy object
>however. Getting spoiled already.
Check out the datasource.runSelect(dbclass, query) method. It will
run any query you supply and construct instances of dbclass from the
result. Just make sure all the columns you need are there.
Note that with postgres, that will give you dbobjects, that have
oid = None even though they are stored within the database already.
This might solve the problems with views, too, though without
representing them as Python objects and classes properly.
_..._ Diedrich Vorberg
/ _ _ \ http://www.tux4web.de
| (o)_(o) | email@example.com
\( ) / .---.
//'._.'\ \ / \ Internet Dienstleistungen
// . \ \ \.@-@./ und 'Consulting'.
|| . \ \ /`\_/`\
|\ : / | // _ \\ Linux Rules!
\ `) ' (` /_ | \ )|_
_)``".____,.'"` (_ /`\_`> <_/ \
) )'--'( ( \__/'---'\__/