[orm-devel] Re: Postgres & Views
Julio Rommi Oņa Miranda
Sat, 23 Nov 2002 00:14:58 -0400
> 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).
Yes, maybe heritance is not the answare but something like the columns
classes. Let me think...
But first, I would like to say some ideas I have:
There is no way, on the actual design to select data based on the >,<,=<,=>
operators or using between, in or like. this could be done by creating
another classes exploiting the column objects idea. This could lead us to
p=ds.select(person, name=like("john"), birth=between(d1,d2))
when generating the sql query, assuming d1 and d2 as date varibles, this
should expand to:
select * from person where name like "%john%" and birth between
well, with this there could be easy go to something I would like to call
"selectors", that are simply list of conditions so:
so there work like giving to select both conditions an generating a query
similar to the previous one.
This will help on creating a proxy inside the datasource class, using weak
references in a dictionary where the key is the selector and the value the
dbclass returned by the query. This should lead to a better response time,
because every time an already read object is selected, there is no need to go
to the database and there is no need to synchronize the previous calls.
Some Ideas I've got