[Erp5-report] r21030 - /erp5/trunk/products/ERP5Type/Constraint/

nobody at svn.erp5.org nobody at svn.erp5.org
Tue May 20 13:51:04 CEST 2008


Author: jerome
Date: Tue May 20 13:51:00 2008
New Revision: 21030

URL: http://svn.erp5.org?rev=21030&view=rev
Log:
Documentation fixes, "This is the check method, we return a list of string,
each string corresponds to an error" was wrong, constraints returns some
ConsistencyMessage instances


Modified:
    erp5/trunk/products/ERP5Type/Constraint/AttributeEquality.py
    erp5/trunk/products/ERP5Type/Constraint/CategoryAcquiredMembershipArity.py
    erp5/trunk/products/ERP5Type/Constraint/CategoryExistence.py
    erp5/trunk/products/ERP5Type/Constraint/CategoryMembershipArity.py
    erp5/trunk/products/ERP5Type/Constraint/CategoryMembershipState.py
    erp5/trunk/products/ERP5Type/Constraint/CategoryRelatedMembershipArity.py
    erp5/trunk/products/ERP5Type/Constraint/PortalTypeClass.py
    erp5/trunk/products/ERP5Type/Constraint/PropertyExistence.py
    erp5/trunk/products/ERP5Type/Constraint/PropertyTypeValidity.py
    erp5/trunk/products/ERP5Type/Constraint/StringAttributeMatch.py
    erp5/trunk/products/ERP5Type/Constraint/TALESConstraint.py

Modified: erp5/trunk/products/ERP5Type/Constraint/AttributeEquality.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Constraint/AttributeEquality.py?rev=21030&r1=21029&r2=21030&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Constraint/AttributeEquality.py (original)
+++ erp5/trunk/products/ERP5Type/Constraint/AttributeEquality.py Tue May 20 13:51:00 2008
@@ -51,9 +51,7 @@
        "value is ${current_value} but should be ${expected_value} (Fixed)"
 
   def checkConsistency(self, obj, fixit=0):
-    """
-      This is the check method, we return a list of string,
-      each string corresponds to an error.
+    """Check the object's consistency.
       We will make sure that each non None constraint_definition is 
       satisfied (equality)
     """

Modified: erp5/trunk/products/ERP5Type/Constraint/CategoryAcquiredMembershipArity.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Constraint/CategoryAcquiredMembershipArity.py?rev=21030&r1=21029&r2=21030&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Constraint/CategoryAcquiredMembershipArity.py (original)
+++ erp5/trunk/products/ERP5Type/Constraint/CategoryAcquiredMembershipArity.py Tue May 20 13:51:00 2008
@@ -33,10 +33,10 @@
 
 class CategoryAcquiredMembershipArity(CategoryMembershipArity):
   """
-    This method check and fix if an object respects the arity.
-    For example we can check if every Order has at
-    least one source.
-    Configuration exemple:
+    This method checks if an object respects the arity.
+
+    For example we can check if every Order has at least one source.
+    Configuration example:
     { 'id'            : 'source',
       'description'   : '',
       'type'          : 'CategoryAcquiredMembershipArity',

Modified: erp5/trunk/products/ERP5Type/Constraint/CategoryExistence.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Constraint/CategoryExistence.py?rev=21030&r1=21029&r2=21030&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Constraint/CategoryExistence.py (original)
+++ erp5/trunk/products/ERP5Type/Constraint/CategoryExistence.py Tue May 20 13:51:00 2008
@@ -56,9 +56,7 @@
                                              portal_type=portal_type))
 
   def checkConsistency(self, obj, fixit=0):
-    """
-      This is the check method, we return a list of string,
-      each string corresponds to an error.
+    """Check the object's consistency.
     """
     if not self._checkConstraintCondition(obj):
       return []
@@ -85,8 +83,8 @@
 
 
 class CategoryAcquiredExistence(CategoryExistence):
-  """This constraint check an object respects the existence of a category, with
-  acquisition.
+  """This constraint checks if an object respects the existence of a category,
+  with acquisition.
 
     Configuration example:
     { 'id'            : 'category_existence',

Modified: erp5/trunk/products/ERP5Type/Constraint/CategoryMembershipArity.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Constraint/CategoryMembershipArity.py?rev=21030&r1=21029&r2=21030&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Constraint/CategoryMembershipArity.py (original)
+++ erp5/trunk/products/ERP5Type/Constraint/CategoryMembershipArity.py Tue May 20 13:51:00 2008
@@ -31,9 +31,9 @@
 
 class CategoryMembershipArity(Constraint):
   """
-    This method check and fix if an object respects the arity.
-    For example we can check if every Order has at
-    least one source.
+    This constraint checks if an object respects the arity.
+
+    For example we can check if every Order has at least one source.
     Configuration exemple:
     { 'id'            : 'source',
       'description'   : '',
@@ -45,6 +45,7 @@
       'condition'     : 'python: object.getPortalType() == 'Foo',
     },
   """
+
   _message_id_list = ['message_arity_too_small',
                    'message_arity_not_in_range',
                    'message_arity_with_portal_type_to_small',
@@ -73,9 +74,7 @@
                                               portal_type=portal_type))
 
   def checkConsistency(self, obj, fixit=0):
-    """
-      This is the check method, we return a list of string,
-      each string corresponds to an error.
+    """Check the object's consistency.
       We are looking the definition of the constraing where
       are defined the minimum and the maximum arity, and the
       list of objects we wants to check the arity.

Modified: erp5/trunk/products/ERP5Type/Constraint/CategoryMembershipState.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Constraint/CategoryMembershipState.py?rev=21030&r1=21029&r2=21030&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Constraint/CategoryMembershipState.py (original)
+++ erp5/trunk/products/ERP5Type/Constraint/CategoryMembershipState.py Tue May 20 13:51:00 2008
@@ -51,12 +51,7 @@
       "which is not in ${valid_state_list}"
 
   def checkConsistency(self, obj, fixit=0):
-    """
-      This is the check method, we return a list of string,
-      each string corresponds to an error.
-      We are looking the definition of the constraing where
-      are defined the minimum and the maximum arity, and the
-      list of objects we wants to check the arity.
+    """Check the object's consistency.
     """
     if not self._checkConstraintCondition(obj):
       return []
@@ -64,7 +59,7 @@
     # Retrieve values inside de PropertySheet (_constraints)
     base_category = self.constraint_definition['base_category']
     portal_type = self.constraint_definition['portal_type']
-    membership_list = obj.getValueList(base_category, 
+    membership_list = obj.getValueList(base_category,
                                        portal_type=portal_type)
     state_var_list = self.constraint_definition.copy()
     state_var_list.pop('portal_type')

Modified: erp5/trunk/products/ERP5Type/Constraint/CategoryRelatedMembershipArity.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Constraint/CategoryRelatedMembershipArity.py?rev=21030&r1=21029&r2=21030&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Constraint/CategoryRelatedMembershipArity.py (original)
+++ erp5/trunk/products/ERP5Type/Constraint/CategoryRelatedMembershipArity.py Tue May 20 13:51:00 2008
@@ -33,8 +33,9 @@
 
 class CategoryRelatedMembershipArity(CategoryMembershipArity):
   """
-    This method check and fix if an object respects the arity
-    from a category reverse membership point of view.
+    This method checks if an object respects the arity from a category reverse
+    membership point of view.
+
     For example we can check if every Order has at
     most one Order Applied Rule.
     Configuration example: 

Modified: erp5/trunk/products/ERP5Type/Constraint/PortalTypeClass.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Constraint/PortalTypeClass.py?rev=21030&r1=21029&r2=21030&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Constraint/PortalTypeClass.py (original)
+++ erp5/trunk/products/ERP5Type/Constraint/PortalTypeClass.py Tue May 20 13:51:00 2008
@@ -61,9 +61,7 @@
       " document class is ${document_class}"
 
   def checkConsistency(self, obj, fixit=0):
-    """
-      This is the check method, we return a list of string,
-      each string corresponds to an error.
+    """Check the object's consistency.
     """
     if not self._checkConstraintCondition(obj):
       return []

Modified: erp5/trunk/products/ERP5Type/Constraint/PropertyExistence.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Constraint/PropertyExistence.py?rev=21030&r1=21029&r2=21030&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Constraint/PropertyExistence.py (original)
+++ erp5/trunk/products/ERP5Type/Constraint/PropertyExistence.py Tue May 20 13:51:00 2008
@@ -31,8 +31,8 @@
 
 class PropertyExistence(Constraint):
   """
-    This method check and fix if an object respects the existence of a
-    property.
+    This method checks if an object respects the existence of a property.
+
     For example we can check if every invoice line has a price defined
     on it.
     Configuration example:
@@ -52,9 +52,7 @@
             "${property_id}, this property is not defined"
 
   def checkConsistency(self, obj, fixit=0):
-    """
-      This is the check method, we return a list of string,
-      each string corresponds to an error.
+    """Check the object's consistency.
     """
     if not self._checkConstraintCondition(obj):
       return []

Modified: erp5/trunk/products/ERP5Type/Constraint/PropertyTypeValidity.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Constraint/PropertyTypeValidity.py?rev=21030&r1=21029&r2=21030&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Constraint/PropertyTypeValidity.py (original)
+++ erp5/trunk/products/ERP5Type/Constraint/PropertyTypeValidity.py Tue May 20 13:51:00 2008
@@ -79,9 +79,7 @@
   
 
   def checkConsistency(self, obj, fixit=0):
-    """
-      This is the check method, we return a list of string,
-      each string corresponds to an error.
+    """Check the object's consistency.
     """
     error_list = []
     # For each attribute name, we check type

Modified: erp5/trunk/products/ERP5Type/Constraint/StringAttributeMatch.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Constraint/StringAttributeMatch.py?rev=21030&r1=21029&r2=21030&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Constraint/StringAttributeMatch.py (original)
+++ erp5/trunk/products/ERP5Type/Constraint/StringAttributeMatch.py Tue May 20 13:51:00 2008
@@ -31,9 +31,9 @@
 
 class StringAttributeMatch(PropertyExistence):
   """
-    This constraint class allows to check
-    that a string property match a regular 
-    expression. Configuration example:
+    This constraint class allows to check that a string property matches a
+    regular expression.
+    Configuration example:
     { 'id'            : 'title_not_empty',
       'description'   : 'Title must be defined',
       'type'          : 'StringAttributeMatch',
@@ -48,10 +48,8 @@
      "${attribute_value} and does not match ${regular_expression}."
 
   def checkConsistency(self, object, fixit=0):
-    """
-    This is the check method, we return a list of string,
-    each string corresponds to an error.
-    Check that each attribute does not match the RE
+    """Check the object's consistency.
+    Check that each attribute matches the regular expression.
     """
     error_list = PropertyExistence.checkConsistency(
                                   self, object, fixit=fixit)

Modified: erp5/trunk/products/ERP5Type/Constraint/TALESConstraint.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Constraint/TALESConstraint.py?rev=21030&r1=21029&r2=21030&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Constraint/TALESConstraint.py (original)
+++ erp5/trunk/products/ERP5Type/Constraint/TALESConstraint.py Tue May 20 13:51:00 2008
@@ -59,7 +59,8 @@
       "Error while evaluating expression: ${error_text}"
 
   def checkConsistency(self, obj, fixit=0):
-    """See Interface """
+    """Check the object's consistency.
+    """
     # import this later to prevent circular import
     from Products.ERP5Type.Utils import createExpressionContext
     if not self._checkConstraintCondition(obj):




More information about the Erp5-report mailing list