Eve from Adams' Ribs
Gregory Bond
gnb at itga.com.au
Tue Aug 23 02:56:30 EDT 2005
Godwin wrote:
> But the funny fact is that i want this class to be dynamically
> generated at run
> time simply from a table name string.
>
The thing you are looking for is called an "object-relational mapper".
try SQLObject http://sqlobject.org/
This is mainly intended to work the other way (i.e. describe the
structure in Python and create tables from that), but it does support a
"get the structure from a legacy table" mode that may be good enough
(you may be in strife if your existing tables don't meet certain
requirements, like having a unique integer key, or have odd
column-naming schema etc). I don't think it supports Oracle (yet...)
More information about the Python-list
mailing list