How to deal with relational data?

Jeff Shannon jeff at ccvcorp.com
Tue Apr 2 16:02:04 EST 2002


In article <3CA8D205.3C9E742B at computer.dot.org>, 
Steven.dot.Suchting. at computer.dot.org says...

> How do we Python programmers typically deal with creating and using
> objects in which the source data is stored in a relational data base?
 
I am about as far from being database-savvy as a programmer can 
be, but... AFAICS, a database table should be more-or-less 
representable as a dictionary in Python, shouldn't it?  If you 
read each group of objects into a dictionary, keyed on the 
table's index value, then references to another object become the 
key by which that object is stored in its appropriate dictionary.  

Of course, if you have many deeply-nested cross-referencing 
tables, this could become unwieldy.  But it could help out.  If 
nothing else, you can cache some of your lower-level leaf objects 
in dictionaries.

-- 

Jeff Shannon
Technician/Programmer
Credit International



More information about the Python-list mailing list