Commit 6adf6bdd authored by Jean-Paul Smets's avatar Jean-Paul Smets

first working version of PropertyExistence


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2700 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 60b824df
......@@ -54,10 +54,10 @@ class PropertyExistence(Constraint):
# Check arity and compare it with the min and max
error_message = None
if not self.hasProperty(property_id):
if not object.hasProperty(property_id):
error_message = "Property existence error for property '%s': " % property_id \
+ " this document has no such property"
elif self.getProperty(property_id) is None:
elif object.getProperty(property_id) is None:
error_message = "Property existence error for property '%s': " % property_id \
+ " this property was not defined"
if error_message:
......
......@@ -3,3 +3,4 @@ from PropertyTypeValidity import PropertyTypeValidity
from CategoryMembershipArity import CategoryMembershipArity
from CategoryRelatedMembershipArity import CategoryRelatedMembershipArity
from AttributeEquality import AttributeEquality
from PropertyExistence import PropertyExistence
\ No newline at end of file
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