[Zope-DB] Re: [Zope] List & Dictionary properties; General property handling thoughts

Steve Spicklemire steve@spvi.com
Thu, 27 Dec 2001 06:01:34 -0500


Hi Eron,

	I believe tokens and lines properties are actually implemented as 
lists in python, so you should be able to use them that way. Maybe if 
you could give a compelling use-case for a dictionary property it would 
help clarify the need? In my own experience it seems that when at first 
I think I need a dictionary property.. what I really need is another 
class. ;-)

-steve


On Wednesday, December 26, 2001, at 05:37 PM, Eron Lloyd wrote:

> This may seem like a redundant question, but this is the third time 
> I've come
> across the desire to be able to store values persistantly as lists or
> dictionaries. I've read all the suggestions in the archives pointing out
> alternatives (<dtml-return expr="{'id': 'item'}">, TinyTable,
> string.split('value1|value2|..', '|'), "lines" property, SQL DB, etc.) 
> but I
> still don't quite get the "Zen" of why this wouldn't make sense in 
> practice.
> People have mentioned that it seems redundant with existing structures 
> like
> tokens or lines, but these don't seem to have all the familiar benefits 
> of
> lists and dicts, like instantly accessible mutability and _methods_, 
> plus no
> added overhead. I know you can manipulate data within lists & dicts in a
> Python script, but it's just not why I require.
>
> Following this thought, I wonder if it wouldn't be handy to be able to 
> cut,
> copy, & paste properties between valid objects, and provide a way to 
> convert
> existing property values to different types? Also, the ability to
> import/export propertysheets of OFS objects could be useful as well 
> (like in
> ZClasses). The facilities to do these things already exist, so would it 
> be
> agreed by others in the community to promote these changes? Is it too 
> late to
> try and work this into Zope3?
>
> Trying-to-help-Zope-grow-10x-ingly yours,
>
> Eron
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )