[schema] turn comment into docstring for RQLUniqueConstraint stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 14 Sep 2010 15:33:28 +0200
branchstable
changeset 6233 612b7d947a4c
parent 6232 d992176d17b7
child 6234 ae97a8c818e5
[schema] turn comment into docstring for RQLUniqueConstraint
schema.py
--- a/schema.py	Tue Sep 14 15:33:01 2010 +0200
+++ b/schema.py	Tue Sep 14 15:33:28 2010 +0200
@@ -750,13 +750,14 @@
 
 class RQLUniqueConstraint(RepoEnforcedRQLConstraintMixIn, BaseRQLConstraint):
     """the unique rql constraint check that the result of the query isn't
-    greater than one
-    """
-    distinct_query = True
+    greater than one.
 
-    # XXX turns mainvars into a required argument in __init__, since we've no
-    #     way to guess it correctly (eg if using S,O or U the constraint will
-    #     always be satisfied since we've to use a DISTINCT query)
+    You *must* specify mainvars when instantiating the constraint since there is
+    no way to guess it correctly (e.g. if using S,O or U the constraint will
+    always be satisfied because we've to use a DISTINCT query).
+    """
+    # XXX turns mainvars into a required argument in __init__
+    distinct_query = True
 
     def match_condition(self, session, eidfrom, eidto):
         return len(self.exec_query(session, eidfrom, eidto)) <= 1