entity.py
branchstable
changeset 3746 74192424b2c8
parent 3689 deb13e88e037
child 3777 3ef8cdb5fb1c
child 3826 0c0c051863cb
equal deleted inserted replaced
3745:006c81b94ec5 3746:74192424b2c8
   884         for attr, values in kwargs.iteritems():
   884         for attr, values in kwargs.iteritems():
   885             if attr.startswith('reverse_'):
   885             if attr.startswith('reverse_'):
   886                 restr = 'Y %s X' % attr[len('reverse_'):]
   886                 restr = 'Y %s X' % attr[len('reverse_'):]
   887             else:
   887             else:
   888                 restr = 'X %s Y' % attr
   888                 restr = 'X %s Y' % attr
       
   889             if not isinstance(values, (tuple, list, set, frozenset)):
       
   890                 values = (values,)
   889             execute('SET %s WHERE X eid %%(x)s, Y eid IN (%s)' % (
   891             execute('SET %s WHERE X eid %%(x)s, Y eid IN (%s)' % (
   890                 restr, ','.join(str(r.eid) for r in values)),
   892                 restr, ','.join(str(r.eid) for r in values)),
   891                     {'x': self.eid}, 'x')
   893                     {'x': self.eid}, 'x')
   892 
   894 
   893     def delete(self):
   895     def delete(self):