> One question I have is regarding how to store my data in the database.
> The records I'm dealing with could be nicely represented by a set of
> interrelated Python objects.  Is it better to simply pickle these
> objects and store the results in the SQL database, or better to
> rebuild the objects from the database rows each time the data is
> retrieved?

This is really application specific, but here is what I did on some 
projects:

User information is stored in related tables and I query a db view to 
pull in all of the required info about a user (preferences, security 
level etc...) Then I build an instance of a user class and stick that 
into a session as a py object.

News Articles were stored in a db but I used a python object to sql 
mapping (MiddleKit) to allow me to work with objects.  I called 
articles.save() and then the mapping writes and executed the required sql.

Application settings are stored in a py module as a python dict.  This 
never changes during an application run, so it is used a module variable.

 From mySettings import Settings
self.writeln( 'Welcome to app version' % Settings.version )

I like using a db table because I can manipulate the data outside of 
python, but using native objects is easier.  It really depends upon how 
you will aquire the data also.

-Aaron





-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to