# HG changeset patch # User Sylvain Thénault # Date 1249407382 -7200 # Node ID ade3196741707710a7d560905b68207db5a1dad4 # Parent 38a4e83c8160632d58b83f9354b3706fb318220c add consistency check on constraints diff -r 38a4e83c8160 -r ade319674170 schema.py --- a/schema.py Tue Aug 04 18:58:54 2009 +0200 +++ b/schema.py Tue Aug 04 19:36:22 2009 +0200 @@ -516,6 +516,11 @@ def __init__(self, restriction): self.restriction = restriction + def check_consistency(self, subjschema, objschema): + if objschema.is_final(): + raise BadSchemaDefinition("unique constraint doesn't apply to " + "final entity type") + def serialize(self): return self.restriction