Eve from Adams' Ribs

Godwin godwinburby at gmail.com
Tue Aug 23 07:02:05 CEST 2005

Dear Pythoneer,
     I'm thinking of making a class out of an rdbms table name(let's
say oracle).
I can dynamically query the column names and their datatypes from
oracle. So at runtime can i create a class object that creates a class
for example employee with methods that can manipulate that table. For
example :

class Employee(object):

	def insert(self,**kwds):
		"should insert values into the table based on column and value pairs

	def update(self,**kwds):
		"should update the table"

	def delete(self,where):
		"should delete a row"

	def select(self,*cols,where)
		"should retrieve results based on columns and where clause"

But the funny fact is that i want this class to be dynamically
generated at run
time simply from a table name string. "Yes i want to create Eve out of
Adams' rib". I think its possible with python as it is called a dynamic
language. Would u let me on this python secret?

More information about the Python-list mailing list