[schema] neuter check method for constraints we implement in sql
Closes #5154406.
--- a/schema.py Sun Mar 22 23:27:13 2015 +0100
+++ b/schema.py Sun Mar 22 19:10:13 2015 +0100
@@ -35,7 +35,8 @@
from yams import BadSchemaDefinition, buildobjs as ybo
from yams.schema import Schema, ERSchema, EntitySchema, RelationSchema, \
RelationDefinitionSchema, PermissionMixIn, role_name
-from yams.constraints import BaseConstraint, FormatConstraint
+from yams.constraints import (BaseConstraint, FormatConstraint, BoundaryConstraint,
+ IntervalBoundConstraint, StaticVocabularyConstraint)
from yams.reader import (CONSTRAINTS, PyFileReader, SchemaLoader,
obsolete as yobsolete, cleanup_sys_modules,
fill_schema_from_namespace)
@@ -1108,6 +1109,12 @@
# additional cw specific constraints ###########################################
+# these are implemented as CHECK constraints in sql, don't do the work
+# twice
+StaticVocabularyConstraint.check = lambda *args: True
+IntervalBoundConstraint.check = lambda *args: True
+BoundaryConstraint.check = lambda *args: True
+
class BaseRQLConstraint(RRQLExpression, BaseConstraint):
"""base class for rql constraints"""
distinct_query = None