Storing a Python Dictionary in MySQL

drs drs at ecp.cc
Wed May 28 01:19:45 EDT 2003


"J. Filici" <alaxsxaq at hotmail.com> wrote in message
news:a6d7ff4e.0305271449.764c51cb at posting.google.com...
> I have written a CGI utility that collects form data into a MySQL
> database for persistent storage.
>
> In planning for improvements to this utility, I'm looking at a better
> way to store the form data.  My utility builds a dictionary from the
> form input field names and values and I'm thinking that I could just
> store that dictionary in a clob field in MySQL.  What's the best way
> to do this?  I need to be able to store the entire dictionary for each
> form post

a) if you insist on MySQL, and your data is as you describe it, you should
pickle the dictionary and dump it.

b) if you do not insist on MySQL, I would suggest looking into ZODB as a
simple and effective way to do this.

-drs






More information about the Python-list mailing list