dataimport.py
branchstable
changeset 9425 d7e8293fa4de
parent 9181 2eac0aa1d3f6
child 9440 6880674c1a26
child 9522 8154a5748194
equal deleted inserted replaced
9424:5027afeb5739 9425:d7e8293fa4de
  1056             data = {'cw_eid': subject, SQL_PREFIX + rtype: object}
  1056             data = {'cw_eid': subject, SQL_PREFIX + rtype: object}
  1057             subjtype = kwargs.get('subjtype')
  1057             subjtype = kwargs.get('subjtype')
  1058             if subjtype is None:
  1058             if subjtype is None:
  1059                 # Try to infer it
  1059                 # Try to infer it
  1060                 targets = [t.type for t in
  1060                 targets = [t.type for t in
  1061                            self.schema.rschema(rtype).targets()]
  1061                            self.schema.rschema(rtype).subjects()]
  1062                 if len(targets) == 1:
  1062                 if len(targets) == 1:
  1063                     subjtype = targets[0]
  1063                     subjtype = targets[0]
  1064                 else:
  1064                 else:
  1065                     raise ValueError('You should give the subject etype for '
  1065                     raise ValueError('You should give the subject etype for '
  1066                                      'inlined relation %s'
  1066                                      'inlined relation %s'