Commit 6a88abf9 authored by Adrien Di Mascio's avatar Adrien Di Mascio
Browse files

EntitySchema.check: allow an explicit set of relations to be checked rather than all relations

--HG--
branch : stable
parent d8e83fc344b3
ChangeLog for yams
------------------
--
* EntitySchema.check() accepts an explicit set of relations to check
2010-02-26 -- 0.28.0
* proper attribute permissions: should now use 'update' instead of 'add'/'delete'
......
......@@ -475,12 +475,13 @@ class EntitySchema(PermissionMixIn, ERSchema):
## validation ######################
def check(self, entity, creation=False, _=unicode):
def check(self, entity, creation=False, _=unicode, relations=None):
"""check the entity and raises an ValidationError exception if it
contains some invalid fields (ie some constraints failed)
"""
errors = {}
for rschema in self.subject_relations():
relations = relations or self.subject_relations()
for rschema in relations:
if not rschema.final:
continue
aschema = self.destination(rschema)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment