[Zope3-dev] Should containers tell you if they accept empty
string keys?
Leonardo Rochael Almeida
leo@hiper.com.br
18 Nov 2002 19:55:55 -0200
On Mon, 2002-11-18 at 18:58, Florent Guillaume wrote:
> Guido van Rossum <guido@python.org> wrote:
> > > > In particular, if you pass the returned key to another call to
> > > > setObject(), will it overwrite the object whose setObject() call
> > > > returned that key, or will it generate a new key again???
> > >
> > > If the container doesn't ignore the key, it will generate a
> > > DuplicationError.
> >
> > Ah, so setObject() can't be used to overwrite an existing object.
> > That simplifies things.
>
> Note that Zope 2 objects have the option to declare
> __replaceable__ = Globals.REPLACEABLE
> to allow themselves to be overwritten by another object with the same id.
>
> However I don't know what it's used for in Zope 2, and if it's a planned
> feature for Zope 3.
it's used, for example, to provide overridable templates. exUserFolder
uses it to provide a default, but overridable dialog template, which
frames all exUserFolder forms.
--
Ideas don't stay in some minds very long because they don't like
solitary confinement.