[DB-SIG] Re: DB-SIG Digest, Vol 2, Issue 9

ali rmangaliag at slu.edu.ph
Wed May 14 15:29:00 EDT 2003

i'm quite a python newbie and
i dont actually know if this is a valid question here... anyway, here it

is there an available program/software that translates a database
structure/schema to python classes (code)???


if i have a database table created using this sql:

create table sample (sid int unique, sname char(20));

the program will create a python file with this format:

class sample:
    def __init__(self, sid, sname=None):
        self.sid = sid
        self.sname = sname
    def setsid(self, sid):
        self.sid = sid
    def setsname(self, sname):
        self.sname = sname
    def getsid(self): return self.sid
    def getsname(self): return self.sname

More information about the DB-SIG mailing list