Add a more explicite message for Classification.classifies rqlconstraint failure stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Fri, 18 Dec 2009 14:55:29 +0100
branchstable
changeset 94 96afbdf49ee0
parent 93 8156a8755692
child 95 40beb6f7c57d
Add a more explicite message for Classification.classifies rqlconstraint failure
schema.py
--- a/schema.py	Mon Dec 14 13:05:01 2009 +0100
+++ b/schema.py	Fri Dec 18 14:55:29 2009 +0100
@@ -22,8 +22,12 @@
     name = String(required=True, fulltextindexed=True, unique=True,
                   maxsize=128)
     classifies = SubjectRelation('CWEType',
-                                 # see relation type docstring
-                                 constraints = [RQLConstraint('RDEF to_entity O, RDEF relation_type R, R name "applied_to"')])
+                     # see relation type docstring
+                     constraints = [RQLConstraint('RDEF to_entity O,'
+                                                  'RDEF relation_type R,'
+                                                  'R name "applied_to"',
+                     msg="Classification is trying to classifies an EntityType "
+                         "without applied_to relation")])
 
 
 class classifies(RelationType):