equal
deleted
inserted
replaced
123 except RegistryException: |
123 except RegistryException: |
124 raise RegistryException('Unknown action %s' % action) |
124 raise RegistryException('Unknown action %s' % action) |
125 |
125 |
126 def list_actions(self): |
126 def list_actions(self): |
127 reg = self._cw.vreg['components'] |
127 reg = self._cw.vreg['components'] |
128 return sorted(clss[0].action for rid, clss in reg.iteritems() |
128 return sorted(clss[0].action for rid, clss in reg.items() |
129 if rid.startswith('cw.entityxml.action.')) |
129 if rid.startswith('cw.entityxml.action.')) |
130 |
130 |
131 # mapping handling ######################################################### |
131 # mapping handling ######################################################### |
132 |
132 |
133 def add_schema_config(self, schemacfg, checkonly=False): |
133 def add_schema_config(self, schemacfg, checkonly=False): |
219 self.process_relations(entity, rels) |
219 self.process_relations(entity, rels) |
220 return entity |
220 return entity |
221 |
221 |
222 def process_relations(self, entity, rels): |
222 def process_relations(self, entity, rels): |
223 etype = entity.cw_etype |
223 etype = entity.cw_etype |
224 for (rtype, role, action), rules in self.source.mapping.get(etype, {}).iteritems(): |
224 for (rtype, role, action), rules in self.source.mapping.get(etype, {}).items(): |
225 try: |
225 try: |
226 related_items = rels[role][rtype] |
226 related_items = rels[role][rtype] |
227 except KeyError: |
227 except KeyError: |
228 self.import_log.record_error('relation %s-%s not found in xml export of %s' |
228 self.import_log.record_error('relation %s-%s not found in xml export of %s' |
229 % (rtype, role, etype)) |
229 % (rtype, role, etype)) |