Commit f6ea216e authored by Jérome Perrin's avatar Jérome Perrin

- generate code indented with 2 spaces

- use "error_list" instead of "errors"


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33927 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 17fdef01
...@@ -336,19 +336,19 @@ from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces ...@@ -336,19 +336,19 @@ from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.ERP5Type.XMLObject import XMLObject from Products.ERP5Type.XMLObject import XMLObject
class %s(XMLObject): class %s(XMLObject):
# CMF Type Definition # CMF Type Definition
meta_type = 'MYPROJECT Template Document' meta_type = 'MYPROJECT Template Document'
portal_type = 'Template Document' portal_type = 'Template Document'
# Declarative security # Declarative security
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
# Default Properties # Default Properties
property_sheets = ( PropertySheet.Base property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject , PropertySheet.XMLObject
, PropertySheet.CategoryCore , PropertySheet.CategoryCore
, PropertySheet.DublinCore , PropertySheet.DublinCore
)""" % (COPYRIGHT, class_id) )""" % (COPYRIGHT, class_id)
self.writeLocalDocument(class_id, text) self.writeLocalDocument(class_id, text)
if REQUEST is not None: if REQUEST is not None:
...@@ -423,16 +423,16 @@ class %s(XMLObject): ...@@ -423,16 +423,16 @@ class %s(XMLObject):
############################################################################## ##############################################################################
class %s: class %s:
\"\"\" \"\"\"
%s properties for all ERP5 objects %s properties for all ERP5 objects
\"\"\" \"\"\"
_properties = ( _properties = (
{ 'id' : 'a_property', { 'id' : 'a_property',
'description' : 'A local property description', 'description' : 'A local property description',
'type' : 'string', 'type' : 'string',
'mode' : '' }, 'mode' : '' },
) )
""" % (COPYRIGHT, class_id, class_id) """ % (COPYRIGHT, class_id, class_id)
...@@ -660,22 +660,22 @@ class Test(ERP5TypeTestCase): ...@@ -660,22 +660,22 @@ class Test(ERP5TypeTestCase):
from Products.ERP5Type.Constraint import Constraint from Products.ERP5Type.Constraint import Constraint
class %s(Constraint): class %s(Constraint):
\"\"\"
Explain here what this constraint checker does
\"\"\"
def checkConsistency(self, obj, fixit = 0):
\"\"\" \"\"\"
Explain here what this constraint checker does Implement here the consistency checker
whenever fixit is not 0, object data should be updated to
satisfy the constraint
\"\"\" \"\"\"
def checkConsistency(self, obj, fixit = 0): error_list = []
\"\"\"
Implement here the consistency checker
whenever fixit is not 0, object data should be updated to
satisfy the constraint
\"\"\"
errors = []
# Do the job here # Do the job here
return errors return error_list
""" % (COPYRIGHT, class_id) """ % (COPYRIGHT, class_id)
self.writeLocalConstraint(class_id, text) self.writeLocalConstraint(class_id, text)
if REQUEST is not None: if REQUEST is not None:
......
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