[Zope-Checkins] SVN: Zope/trunk/src/OFS/PropertyManager.py Merged r128118:128120 from 2.13 branch
Hano Schlichting
cvs-admin at zope.org
Sun Oct 21 20:15:43 UTC 2012
Log message for revision 128121:
Merged r128118:128120 from 2.13 branch
Changed:
U Zope/trunk/src/OFS/PropertyManager.py
-=-
Modified: Zope/trunk/src/OFS/PropertyManager.py
===================================================================
--- Zope/trunk/src/OFS/PropertyManager.py 2012-10-21 20:13:07 UTC (rev 128120)
+++ Zope/trunk/src/OFS/PropertyManager.py 2012-10-21 20:15:40 UTC (rev 128121)
@@ -269,7 +269,6 @@
dict[p['id']]=p
return dict
-
# Web interface
security.declareProtected(manage_properties, 'manage_addProperty')
@@ -279,7 +278,7 @@
Sets a new property with the given id, type, and value.
"""
if type in type_converters:
- value=type_converters[type](value)
+ value = type_converters[type](value)
self._setProperty(id.strip(), value, type)
if REQUEST is not None:
return self.manage_propertiesForm(self, REQUEST)
@@ -294,16 +293,16 @@
instead for most situations.
"""
for prop in self._propertyMap():
- name=prop['id']
+ name = prop['id']
if 'w' in prop.get('mode', 'wd'):
if prop['type'] == 'multiple selection':
- value=REQUEST.get(name, [])
+ value = REQUEST.form.get(name, [])
else:
- value=REQUEST.get(name, '')
+ value = REQUEST.form.get(name, '')
self._updateProperty(name, value)
if REQUEST:
- message="Saved changes."
- return self.manage_propertiesForm(self,REQUEST,
+ message = "Saved changes."
+ return self.manage_propertiesForm(self, REQUEST,
manage_tabs_message=message)
security.declareProtected(manage_properties, 'manage_changeProperties')
@@ -314,20 +313,23 @@
name=value parameters
"""
if REQUEST is None:
- props={}
- else: props=REQUEST
+ props = {}
+ elif isinstance(REQUEST, dict):
+ props = REQUEST
+ else:
+ props = REQUEST.form
if kw:
for name, value in kw.items():
- props[name]=value
- propdict=self.propdict()
+ props[name] = value
+ propdict = self.propdict()
for name, value in props.items():
if self.hasProperty(name):
if not 'w' in propdict[name].get('mode', 'wd'):
- raise BadRequest, '%s cannot be changed' % escape(name)
+ raise BadRequest('%s cannot be changed' % escape(name))
self._updateProperty(name, value)
if REQUEST:
- message="Saved changes."
- return self.manage_propertiesForm(self,REQUEST,
+ message = "Saved changes."
+ return self.manage_propertiesForm(self, REQUEST,
manage_tabs_message=message)
# Note - this is experimental, pending some community input.
More information about the Zope-Checkins
mailing list