[Zope-dev] ZConfig: Keytype and section type extension

Fred L. Drake, Jr. fred at zope.com
Mon Dec 29 00:28:15 EST 2003


This is the second of two messages proposing ZConfig changes.

"keytype" override and section type extension
---------------------------------------------

ZConfig currently requires that derived section types not specify a
"keytype" attribute, used to change the interpretation of the keys.
The intent is to ensure that keys defined in the base section type
will still be recognized and associated with the same (or equivalent)
settings for the derived type.

In most cases, this is reasonable behavior.  Unfortunately, it makes
it tedious to specialize general base section types in some cases.  Of
particular interest is the case of section types that define no
specific keys, but accept arbitrary keys using

    <key name="+" attribute="some_mapping"/>

For such cases, it can be desirable to change what keys are inserted
into the mapping by changing the keytype of the encosing section type.

Allowing keytype overrides would not affect any existing schema, since
such schema are currently rejected.

One unit test would need to change; the test currently checks that
specifying a keytype for a derived section type raises a SchemaError
exception.


  -Fred

-- 
Fred L. Drake, Jr.  <fred at zope.com>
PythonLabs at Zope Corporation



More information about the Zope-Dev mailing list