schema.py
changeset 10193 a0a11be5a9cb
parent 10192 365e5a0287d6
child 10283 8e6aa8ed6ee1
equal deleted inserted replaced
10192:365e5a0287d6 10193:a0a11be5a9cb
  1092             couples = set((sol['S'], sol['O']) for sol in rqlst.solutions)
  1092             couples = set((sol['S'], sol['O']) for sol in rqlst.solutions)
  1093             for subjtype, objtype in couples:
  1093             for subjtype, objtype in couples:
  1094                 if self[objtype].final:
  1094                 if self[objtype].final:
  1095                     raise BadSchemaDefinition('computed relations cannot be final')
  1095                     raise BadSchemaDefinition('computed relations cannot be final')
  1096                 rdef = ybo.RelationDefinition(
  1096                 rdef = ybo.RelationDefinition(
  1097                     subjtype, rschema.type, objtype)
  1097                     subjtype, rschema.type, objtype,
       
  1098                     __permissions__={'add': (),
       
  1099                                      'delete': (),
       
  1100                                      'read': ('managers', 'users', 'guests')})
  1098                 rdef.infered = True
  1101                 rdef.infered = True
  1099                 self.add_relation_def(rdef)
  1102                 self.add_relation_def(rdef)
  1100 
  1103 
  1101     def rebuild_infered_relations(self):
  1104     def rebuild_infered_relations(self):
  1102         super(CubicWebSchema, self).rebuild_infered_relations()
  1105         super(CubicWebSchema, self).rebuild_infered_relations()