Commit d044cf26 authored by Lennart Regebro's avatar Lennart Regebro

Added pretty label support for properties.

parent a4e1e8a3
......@@ -28,6 +28,11 @@ Zope Changes
"import" new schema components to allow 3rd-party components
(such as storages, databases, or logging handlers) to be used.
- The standard ProperyManager now includes the same label
functionality as the CMF SimpleItemWithProperties object.
By adding a 'label' entry to the property definition you
can now display a prettier label for the property.
Bugs fixed
- Made the control panel properly reflect the cache-size setting
......
......@@ -12,7 +12,7 @@
##############################################################################
"""Property management"""
__version__='$Revision: 1.53 $'[11:-2]
__version__='$Revision: 1.54 $'[11:-2]
import ExtensionClass, Globals
import ZDOM
......@@ -229,6 +229,9 @@ class PropertyManager(ExtensionClass.Base, ZDOM.ElementWithAttributes):
def propertyLabel(self, id):
"""Return a label for the given property id
"""
for p in self._properties:
if p['id'] == id:
return p.get('label', id)
return id
def propdict(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment