comparison idavoll/pgsql_storage.py @ 142:812300cdbc22

Changed behaviour of retraction of items so that only the actually deleted item ids are returned, and no exception is raised for items that didn't actually exists.
author Ralph Meijer <ralphm@ik.nu>
date Tue, 12 Jul 2005 09:23:00 +0000
parents 327de183f48d
children f393bccec4bc
comparison
equal deleted inserted replaced
141:d2c18d88f618 142:812300cdbc22
327 node_id=(SELECT id FROM nodes WHERE node=%s) AND 327 node_id=(SELECT id FROM nodes WHERE node=%s) AND
328 item=%s""", 328 item=%s""",
329 (self.id, 329 (self.id,
330 item_id)) 330 item_id))
331 331
332 if not cursor.rowcount: 332 if cursor.rowcount:
333 raise storage.ItemNotFound 333 deleted.append(item_id)
334
335 return deleted
334 336
335 def get_items(self, max_items=None): 337 def get_items(self, max_items=None):
336 return self._dbpool.runInteraction(self._get_items, max_items) 338 return self._dbpool.runInteraction(self._get_items, max_items)
337 339
338 def _get_items(self, cursor, max_items): 340 def _get_items(self, cursor, max_items):