[Zope] Storing Data inside Zope
Tom P. Allred
Mon, 2 Jun 2003 16:33:43 -0400
>>Just how bad an idea is it to use Zope object Properties to store
>>numeric/text application data?
>Depends. See below for a less glib response.
>Zope objects are a good place to store data, but you should be
>thoughtful about how it is done. Which is to say, you should design
>object-orientedly and not expect to use Zope objects like tables.
I'm using the Client/Cases/Detail/etc granularity and making each record a
single object (using File objects for testing) in an appropriate data folder
(e.g. Case/Data, Client/Data or maybe Data/Client, Data/Case). I create
properties with field names and assign them the field values. That way I
can use the ZMI to create/clone/edit/delete 'data records' easily in
addition to my programs. I'm using Formulator so I can tap the field
definitions programmatically to get the info needed to define the File data
object properties appropriately for each field. I thought about making a
template File data object and cloning it as needed but I haven't figured out
how to do that yet. Besides the dynamic Formulator approach lets me change
form AND 'table' definitions in one spot which is nice for development.
Being shiny new to Zope I'm still grasping the building blocks but thought
ZClasses sounded like what might be useful for this. Thanks for letting me
know that might not be a good idea. I'll continue to fumble through
alternate approaches. It's painfully slow but at least it's interesting.
Thanks to all who have contributed help,
Tom P. Allred, MCSE, RHCE, CCNA
Allred Data Consulting, Inc.