entity.py
changeset 3777 3ef8cdb5fb1c
parent 3720 5376aaadd16b
parent 3746 74192424b2c8
child 3890 d7a270f50f54
equal deleted inserted replaced
3739:817e96eeac5c 3777:3ef8cdb5fb1c
   780         for attr, values in kwargs.iteritems():
   780         for attr, values in kwargs.iteritems():
   781             if attr.startswith('reverse_'):
   781             if attr.startswith('reverse_'):
   782                 restr = 'Y %s X' % attr[len('reverse_'):]
   782                 restr = 'Y %s X' % attr[len('reverse_'):]
   783             else:
   783             else:
   784                 restr = 'X %s Y' % attr
   784                 restr = 'X %s Y' % attr
       
   785             if not isinstance(values, (tuple, list, set, frozenset)):
       
   786                 values = (values,)
   785             execute('SET %s WHERE X eid %%(x)s, Y eid IN (%s)' % (
   787             execute('SET %s WHERE X eid %%(x)s, Y eid IN (%s)' % (
   786                 restr, ','.join(str(r.eid) for r in values)),
   788                 restr, ','.join(str(r.eid) for r in values)),
   787                     {'x': self.eid}, 'x')
   789                     {'x': self.eid}, 'x')
   788 
   790 
   789     def delete(self):
   791     def delete(self):