[Tutor] About classes and databases

Michele Alzetta michele.alzetta at gmail.com
Sun Nov 22 10:12:47 CET 2009


Hallo all!

Long time since I last dabbled in python :-(

I was thinking of a possible solution to a problem I have: I could make a
Class which contains, amongst other things, a couple of datetime.datetime
objects.
The class also will have to contain an element taken from a Tuple and
various elements taken from a series of dictionaries.

First problem: when creating each instance of the class I have to pass it
the information necessary to create the correct datetime objects - how would
I do this?
Second problem: I would find myself to be working with something in the
order of 500 instances of this class contemporaneously, how do I create them
"automatically" from a series of data and once I've created them how do I
grab the correct one when I need it?

Or do you think my approach is all wrong, and it would be better for me not
to use classes at all and to store the data in a database?
But is it possible to store datetime objects and dictionaries in a database?

Thanks for any comments.

Michele
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20091122/ded252a4/attachment.htm>


More information about the Tutor mailing list