Alan G wrote: >>I haven't done much OO in Python yet. For various web apps we write, > > we usually > >>write up a DB schema in a spreadsheet. > > > Wow! How exactly do you represent a schema in a spreadsheet? > I confess I cannot conceive of such a thing. Can you send a > representative sample to illustrate? >
Maybe it's not a "schema" exactly. |Table Name|Fields |Type |Size|Primary Key|Not Null|Unique|Foreign Key| ... |areas |area_id |serial | |x |x |x | | | |area |varchar|80 | |x |x | | | |enabled |boolean| | |x | | | |'s represent each cell. It's just a way to organize your thoughts, and have something a little more readable than an SQ script for a DB schema. There's been less than 20 tables in a database for most of these applications that we write. It's clear enough to see the relations(there's another column references). > >>create the tables in the database. I thought it would be neat to > > save the > >>spreadsheet as a csv file and have python write the sql script. So I > > started to > >>write the Python program. > > > You do know that there are lots of ERD programs that allow you to draw > the schema as an ERD and generate the SQL DDL directly? In fact even > Visio > can do that. > > Alan G. > Can you point me to some Open Source/Free ERD programs that work with Postgre?(I'll google after I send this message.) I'd certainly would like to look at ways to do this better. Last time I looked at Visio which was Visio 2000, the ERD stuff cost extra and was very unstable. Mike _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor