Commit 0f31268c authored by Jérome Perrin's avatar Jérome Perrin

update doc. use `error_list` instead of `errors` name.

remove "XXX How to call only one constraint, even if this constraint is not
defined on property sheet ?" the solution is to do as it's done in the test.
And this is not how application code should use constraints anyway.
  


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18239 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d276478a
...@@ -77,9 +77,6 @@ class Constraint(Interface): ...@@ -77,9 +77,6 @@ class Constraint(Interface):
Products.ERP5Type.Core.Folder.Folder, checkConsistency will be called Products.ERP5Type.Core.Folder.Folder, checkConsistency will be called
recursivly. recursivly.
XXX How to call only one constraint, even if this constraint is not defined
on property sheet ?
""" """
def checkConsistency(obj, fixit=0): def checkConsistency(obj, fixit=0):
...@@ -95,7 +92,7 @@ class Constraint(Interface): ...@@ -95,7 +92,7 @@ class Constraint(Interface):
can simply call:: can simply call::
>>> if something_is_wrong: >>> if something_is_wrong:
>>> errors.append(self._generateError(obj, 'Something is wrong !') >>> error_list.append(self._generateError(obj, 'Something is wrong !')
Then this message ("Something is wrong !") will be translated when the Then this message ("Something is wrong !") will be translated when the
caller of document.checkConsistency() calls getTranslatedMessage() on caller of document.checkConsistency() calls getTranslatedMessage() on
...@@ -105,7 +102,7 @@ class Constraint(Interface): ...@@ -105,7 +102,7 @@ class Constraint(Interface):
'mapping' for substitution, like this:: 'mapping' for substitution, like this::
>>> if something_is_wrong: >>> if something_is_wrong:
>>> errors.append(self._generateError(obj, >>> error_list.append(self._generateError(obj,
... 'Something is wrong: ${wrong_thing}', ... 'Something is wrong: ${wrong_thing}',
... mapping=dict(wrong_thing=obj.getTheWrongThing()))) ... mapping=dict(wrong_thing=obj.getTheWrongThing())))
......
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