[Zope-dev] What would *you* like to have in PropertyManager and friends?

Chris Withers chrisw@nipltd.com
Tue, 29 May 2001 16:28:28 +0100


> On Mon, May 28, 2001 at 09:37:21AM +0100, Chris Withers wrote:
> >
> > Well, a nicer interface for changing them is about all I think they
need.
> > And sort the marshalling stuff out. It would be nice to actually store
blank
> > dates and numbers (None should be a valid value for both of them ;-)
> > That's about all I can see that it needs (probably forgotten something
> > though :-S)
>
> Blank dates&numbers are important, I don' t know how they could
> escape us.

:-)

> As for nicer interface... I guess you' ll have to elaborate a
> bit ;-)

Well, I think it's manage_changeProperties (nasty name for starters) that
deletes any property you don't include in its arguments, see the interfaces
wiki for details.

How about just replacing it with:

def modifyProperties(**kw)

...where kw is a dictionary mapping property name to property value. If it
property specified in kw didn't exist, it would be created.

Also, on addProperty and modifyProperties, how about making type coersion
happen and raise an exception if it fails?

so, if you did addProperty('test','string',1.234), addProperty would coerse
1.234 into the string '1.234' or raise an UncoercableException if it
couldn't?

Might be nice if the available property types were also documented
somewhere.
Hmm, also, coersion should check that when something is stored as the
'lines' property type, it only accepts a list of strings.

cheers,

Chris
> []s,
>                                                |alo
>                                                +----
> --
>            I say a prayer now our love's departed
>                 That you'll come back to stay
>                   Bring back the perfect day
>
> http://www.laranja.org/                mailto:lalo@laranja.org
>          pgp key: http://www.laranja.org/pessoal/pgp
>
> Brazil of Darkness (RPG)      ---       http://www.BroDar.org/
>
>