Commit ef920483 authored by Jean-Paul Smets's avatar Jean-Paul Smets

more clever checking of class attributes


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1072 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ad1b9457
......@@ -320,19 +320,19 @@ def writeLocalDocument(class_id, text):
f.write(text)
def setDefaultClassProperties(document_class):
if not hasattr(document_class, 'isPortalContent'):
if not document_class.__dict__.has_key('isPortalContent'):
document_class.isPortalContent = 1
if not hasattr(document_class, 'isRADContent'):
if not document_class.__dict__.has_key(document_class, 'isRADContent'):
document_class.isRADContent = 1
if not hasattr(document_class, 'add_permission'):
if not document_class.__dict__.has_key(document_class, 'add_permission'):
document_class.add_permission = Permissions.AddPortalContent
if not hasattr(document_class, '__implements__'):
if not document_class.__dict__.has_key(document_class, '__implements__'):
document_class.__implements__ = ()
if not hasattr(document_class, 'property_sheets'):
if not document_class.__dict__.has_key(document_class, 'property_sheets'):
document_class.property_sheets = ()
# Add default factory type information
if not hasattr(document_class, 'factory_type_information') and \
hasattr(document_class, 'meta_type') and hasattr(document_class, 'portal_type'):
if not document_class.__dict__.has_key('factory_type_information') and \
document_class.__dict__.has_key('meta_type') and document_class.__dict__.has_key('portal_type'):
document_class.factory_type_information = \
{ 'id' : document_class.portal_type
, 'meta_type' : document_class.meta_type
......
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