# HG changeset patch # User Sylvain Thénault # Date 1284471208 -7200 # Node ID 612b7d947a4cd88209ad47ed2f26febb980b53bb # Parent d992176d17b7761cedb48ce2f583936c020eaa83 [schema] turn comment into docstring for RQLUniqueConstraint diff -r d992176d17b7 -r 612b7d947a4c 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