equal
deleted
inserted
replaced
91 eschema = self.entity.e_schema |
91 eschema = self.entity.e_schema |
92 for rschema, targetschemas, role in eschema.relation_definitions(): |
92 for rschema, targetschemas, role in eschema.relation_definitions(): |
93 # skip automatically handled relations |
93 # skip automatically handled relations |
94 if rschema.type in DONT_CHECK_RTYPES_ON_ADD: |
94 if rschema.type in DONT_CHECK_RTYPES_ON_ADD: |
95 continue |
95 continue |
96 if role == 'subject': |
96 opcls = role == 'subject' and _CheckSRelationOp or _CheckORelationOp |
97 opcls = _CheckSRelationOp |
|
98 else: |
|
99 opcls = _CheckORelationOp |
|
100 rdef = rschema.role_rdef(eschema, targetschemas[0], role) |
97 rdef = rschema.role_rdef(eschema, targetschemas[0], role) |
101 if rdef.role_cardinality(role) in '1+': |
98 if rdef.role_cardinality(role) in '1+': |
102 self.checkrel_if_necessary(opcls, rschema.type, eid) |
99 self.checkrel_if_necessary(opcls, rschema.type, eid) |
103 |
100 |
104 def before_delete_relation(self): |
101 def before_delete_relation(self): |