# HG changeset patch # User Sylvain Thénault # Date 1269424851 -3600 # Node ID d85f639e91503801485de2c045f4c05fc15fbb5b # Parent ec93dd82c83f64cb2c9f8920d44d853e1b4fdd86 [yams] on creation, specify relations anyway so we don't get spurious warning for accessing eid through the dict api on yams validation diff -r ec93dd82c83f -r d85f639e9150 entity.py --- a/entity.py Wed Mar 24 11:00:02 2010 +0100 +++ b/entity.py Wed Mar 24 11:00:51 2010 +0100 @@ -901,13 +901,16 @@ _ = unicode else: _ = self._cw._ - if creation or not hasattr(self, 'edited_attributes'): + if creation: # on creations, we want to check all relations, especially # required attributes - relations = None - else: + relations = [rschema for rschema in self.e_schema.subject_relations() + if rschema.final and rschema.type != 'eid'] + elif hasattr(self, 'edited_attributes'): relations = [self._cw.vreg.schema.rschema(rtype) for rtype in self.edited_attributes] + else: + relations = None self.e_schema.check(self, creation=creation, _=_, relations=relations)