equal
deleted
inserted
replaced
479 else: |
479 else: |
480 role = 'subject' |
480 role = 'subject' |
481 assert eschema.has_relation(attr, role), '%s %s not found on %s' % (attr, role, eschema) |
481 assert eschema.has_relation(attr, role), '%s %s not found on %s' % (attr, role, eschema) |
482 rschema = eschema.subjrels[attr] if role == 'subject' else eschema.objrels[attr] |
482 rschema = eschema.subjrels[attr] if role == 'subject' else eschema.objrels[attr] |
483 if not rschema.final and isinstance(value, (tuple, list, set, frozenset)): |
483 if not rschema.final and isinstance(value, (tuple, list, set, frozenset)): |
484 if len(value) == 1: |
484 if len(value) == 0: |
|
485 continue # avoid crash with empty IN clause |
|
486 elif len(value) == 1: |
485 value = iter(value).next() |
487 value = iter(value).next() |
486 else: |
488 else: |
487 # prepare IN clause |
489 # prepare IN clause |
488 pending_relations.append( (attr, role, value) ) |
490 pending_relations.append( (attr, role, value) ) |
489 continue |
491 continue |