[SQLObject] Inserting Into Views With PostgreSQL
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: CLIFFORD I. <cli...@di...> - 2004-02-20 19:54:21
|
Hi, 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. Regards, Clifford Ilkay Dinamis Corporation 3266 Yonge Street, Suite 1419 Toronto, Ontario Canada M4N 3P6 Tel: 416-410-3326 |