dataimport.py
changeset 9478 2d7521881d3d
parent 9463 d62e13eba033
parent 9440 6880674c1a26
child 9543 39f981482e34
equal deleted inserted replaced
9475:7863c546b135 9478:2d7521881d3d
  1061             data = {'cw_eid': subject, SQL_PREFIX + rtype: object}
  1061             data = {'cw_eid': subject, SQL_PREFIX + rtype: object}
  1062             subjtype = kwargs.get('subjtype')
  1062             subjtype = kwargs.get('subjtype')
  1063             if subjtype is None:
  1063             if subjtype is None:
  1064                 # Try to infer it
  1064                 # Try to infer it
  1065                 targets = [t.type for t in
  1065                 targets = [t.type for t in
  1066                            self.schema.rschema(rtype).targets()]
  1066                            self.schema.rschema(rtype).subjects()]
  1067                 if len(targets) == 1:
  1067                 if len(targets) == 1:
  1068                     subjtype = targets[0]
  1068                     subjtype = targets[0]
  1069                 else:
  1069                 else:
  1070                     raise ValueError('You should give the subject etype for '
  1070                     raise ValueError('You should give the subject etype for '
  1071                                      'inlined relation %s'
  1071                                      'inlined relation %s'