[orm-devel] Re: Postgres & Views
Fri, 22 Nov 2002 12:53:41 +0100
nice to hear your voice on the list!
>This solution works with view over a single table. But what about a join
>This view class should create the sql query that join both tables and handle
>the one to many realitons as a list.
I didn't test any of this for lack of time, just an idea.
Inheritance of dbclasses doesn't work, really. The columns attribute
of one class simply gets overwriten by the other. What you'd have to
class person_adress(viewclass, person, address):
columns = person.columns.copy() # copy() is essential!
column.update(address.columns) # This will overwrite any column in
# person wich has the same name
# as a column in address
Actually I'm not sure if this is going to work at all. I don't know
how the description tuple of the result will look like and orm depends
on this to map result data to dbobj attributes. Also I columns that
have the same name in both tables are not accounted for, I guess.
However, relationships defined in one of the baseclasses should work
as expected just like the other columns (if they do).
_..._ Diedrich Vorberg
/ _ _ \ http://www.tux4web.de
| (o)_(o) | firstname.lastname@example.org
\( ) / .---.
//'._.'\ \ / \ Internet Dienstleistungen
// . \ \ \.@-@./ und 'Consulting'.
|| . \ \ /`\_/`\
|\ : / | // _ \\ Linux Rules!
\ `) ' (` /_ | \ )|_
_)``".____,.'"` (_ /`\_`> <_/ \
) )'--'( ( \__/'---'\__/