entity.py
changeset 7296 e559ade02665
parent 7293 97505b798975
parent 7288 b156200ebc9d
child 7304 66fa1b7ac784
equal deleted inserted replaced
7294:2af1a4cecda5 7296:e559ade02665
   270             if attr.startswith('reverse_'):
   270             if attr.startswith('reverse_'):
   271                 attr = attr[len('reverse_'):]
   271                 attr = attr[len('reverse_'):]
   272                 role = 'object'
   272                 role = 'object'
   273             else:
   273             else:
   274                 role = 'subject'
   274                 role = 'subject'
   275             assert eschema.has_relation(attr, role)
   275             assert eschema.has_relation(attr, role), '%s %s not found on %s' % (attr, role, eschema)
   276             rschema = eschema.subjrels[attr] if role == 'subject' else eschema.objrels[attr]
   276             rschema = eschema.subjrels[attr] if role == 'subject' else eschema.objrels[attr]
   277             if not rschema.final and isinstance(value, (tuple, list, set, frozenset)):
   277             if not rschema.final and isinstance(value, (tuple, list, set, frozenset)):
   278                 if len(value) == 1:
   278                 if len(value) == 1:
   279                     value = iter(value).next()
   279                     value = iter(value).next()
   280                 else:
   280                 else: