[Zope-dev] TreeVocabulary in zope.schema.vocabulary
Jan-Carel Brand
lists at opkode.com
Fri Jan 27 11:56:15 UTC 2012
On Thu, 2012-01-26 at 15:42 +0100, Charlie Clark wrote:
> Hiya,
>
> Am 26.01.2012, 15:02 Uhr, schrieb Jan-Carel Brand <lists at opkode.com>:
>
> > Ok, Charlie also expressed his reservations. I'll put it in a different
> > package then.
>
> Hang on a minute! While I'm not 100 % convinced of the need in the core I
> think a separate package just for TreeVocabulary would be splitting hairs.
> If z3c.form can use it then I think that is justification enough.
Justification enough to put it in zope.schema?
> > I'm not too sure what to name it though. For example, under what
> > namespace? zope or z3c?
> > I'm guessing zope.vocabulary, or rather zope.treevocabulary?
> >
> >> Furthermore, for the dict class in use in the vocabulary, you could
> >> add a "factory" class that can be overriden easily.
> >> That would allow people with OrderDict capabilities to use them
> >> without having to re-sort later on.
> > Could you please elaborate on what you mean?
> > If I create a factory class to create TreeVocabulary instances, how will
> > overriding that factory (without creating a separate
> > SortableTreeVocabulary) allow people to use OrderedDict?
> > Incidentally, I came upon this: http://pypi.python.org/pypi/ordereddict
> > which provides the OrderedDict to Python 2.4 to 2.7
>
> > I think it might make sense to just subclass OrderedDict and implement
> > an ordered tree from the start.
>
> I agree. Despite my previous remark about class methods, I don't think we
> need to worry much about Python 2.4 and 2.5 and ordered dictionaries are
> just so damn useful that they've been added to the standard library.
More information about the Zope-Dev
mailing list