48 keys.remove((rtype, tagged, stype, '*')) |
48 keys.remove((rtype, tagged, stype, '*')) |
49 return keys |
49 return keys |
50 |
50 |
51 def init(self, schema): |
51 def init(self, schema): |
52 # XXX check existing keys against schema |
52 # XXX check existing keys against schema |
53 for rtype, tagged, stype, otype in self._tagdefs.keys(): |
53 for (rtype, tagged, stype, otype), value in self._tagdefs.items(): |
54 for ertype in (stype, rtype, otype): |
54 for ertype in (stype, rtype, otype): |
55 if ertype != '*' and not ertype in schema: |
55 if ertype != '*' and not ertype in schema: |
56 self.warning('removing rtag for %s, undefined in schema', |
56 self.warning('removing rtag %s: %s, %s undefined in schema', |
57 ertype) |
57 (stype, rtype, otype, tagged), value, ertype) |
58 self.del_rtag(stype, rtype, otype, tagged) |
58 self.del_rtag(stype, rtype, otype, tagged) |
59 if self._initfunc is not None: |
59 if self._initfunc is not None: |
60 for eschema in schema.entities(): |
60 for eschema in schema.entities(): |
61 for rschema, tschemas, role in eschema.relation_definitions(True): |
61 for rschema, tschemas, role in eschema.relation_definitions(True): |
62 for tschema in tschemas: |
62 for tschema in tschemas: |