Commit db31ca26 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Fix typos and the elementary_type getter to return None rather than

raising an exception if the type of a ZODB Property Sheets property
has not been set yet



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40150 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2c3c583f
......@@ -79,7 +79,7 @@ class StandardProperty(XMLObject):
if category.startswith('elementary_type/'):
return category.split('elementary_type/')[1]
raise AttributeError("%s: Could not get elementary_type" % self)
return None
getStorageId = BaseGetter('getStorageId', 'storage_id', 'string')
......@@ -131,7 +131,7 @@ class StandardProperty(XMLObject):
'translatable': self.getTranslatable(),
'translation_domain': self.getTranslationDomain()}
def _convertFromFilesytemPropertyDict(self, filesystem_property_dict):
def _convertFromFilesystemPropertyDict(self, filesystem_property_dict):
"""
Convert a property dict coming from a Property Sheet on the
filesystem to a ZODB property dict
......@@ -162,4 +162,5 @@ class StandardProperty(XMLObject):
"""
Set attributes from the filesystem definition of a property
"""
self.edit(**self._convertFromFilesytemPropertyDict(filesystem_property_dict))
self.edit(**self._convertFromFilesystemPropertyDict(
filesystem_property_dict))
......@@ -63,7 +63,7 @@ class PropertySheetTool(BaseTool):
)
@staticmethod
def _guessFilesytemPropertyPortalType(attribute_dict):
def _guessFilesystemPropertyPortalType(attribute_dict):
"""
Guess the Portal Type of a filesystem-based Property Sheet from
the attributes of the given property
......@@ -91,7 +91,7 @@ class PropertySheetTool(BaseTool):
for attribute_dict in getattr(klass, '_properties', []):
# The property could be either a Standard or an Acquired
# Property
portal_type = self._guessFilesytemPropertyPortalType(attribute_dict)
portal_type = self._guessFilesystemPropertyPortalType(attribute_dict)
# Create the new property and set its attributes
new_property = new_property_sheet.newContent(portal_type=portal_type)
......@@ -103,9 +103,7 @@ class PropertySheetTool(BaseTool):
portal_type = isinstance(category, Expression) and \
'Dynamic Category Property' or 'Category Property'
new_category = new_property_sheet.newContent(
portal_type=portal_type)
new_category = new_property_sheet.newContent(portal_type=portal_type)
new_category.importFromFilesystemDefinition(category)
return new_property_sheet
......
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