Re: [SQLObject] Inserting Into Views With PostgreSQL
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ian B. <ia...@co...> - 2004-02-20 20:29:02
|
CLIFFORD ILKAY wrote: > I really like the way that Oracle treats views as if they were virtual > tables and will allow one to do INSERT, UPDATE, and DELETE operations on > them and I equally dislike the way that PostgreSQL deals with views. It > is NOT straightforward at all. Is there some way using SQLObject that we > can abstract out the awkwardness of views in PostgreSQL. For example, > say we have a classic master/detail relationship, invoice headers and > invoice details. In Oracle, I would create a view called invoices and > simply treat it as if it were a table. Can I do something like the > following in SQLObject? > > class(Invoice): > <define "view" like structure here> > > inv = Invoice.new(bla, bla, bla) > > Some of these views can abstract a fairly complex relationship > consisting of many tables being joined. It is much nicer having to deal > with the abstraction than having to deal with the underlying tables. Daniel's inheritance patch might help you here. The inheritance structure he uses is similar to the item/detail relationship you're talking about. Ian |