[Zope-Checkins] CVS: Zope/lib/python/OFS - PropertySheets.py:1.81.4.1
Andreas Jung
andreas@digicool.com
Fri, 12 Apr 2002 12:42:05 -0400
Update of /cvs-repository/Zope/lib/python/OFS
In directory cvs.zope.org:/tmp/cvs-serv26984/lib/python/OFS
Modified Files:
Tag: Zope-2_5-branch
PropertySheets.py
Log Message:
- Propertysheets: Ids like 'values','keys' and 'values' are
now forbidden as they break WebDAV functionality. Existing
Propertysheets are not affected
=== Zope/lib/python/OFS/PropertySheets.py 1.81 => 1.81.4.1 ===
)
+ __reserved_ids= ('values','items')
+
def property_extensible_schema__(self):
"""Return a flag indicating whether new properties may be
added or removed."""
@@ -116,6 +118,11 @@
# Create a new property set, using the given id and namespace
# string. The namespace string should be usable as an xml name-
# space identifier.
+
+ if id in self.__reserved_ids:
+ raise ValueError, "'%s' is a reserved Id (forbidden Ids are: %s)" % \
+ (id, self.__reserved_ids)
+
self.id=id
self._md=md or {}