code: def lookup(self, nick):
  		query = 
  		''' Ugly, but will work with sqlite3 or pysqlite2 '''
  		messages = [
  			{
  				'fromnick': x[0],
  				'message': x[1],
  				'notifytime': x[2],
  				'notifyid': x[3],
  			}
  			for x in self.db.execute(query, [nick])
  		]
  		ids = [x['notifyid'] for x in messages]
  		query = """
  			DELETE FROM notify
  			WHERE notifyid IN (%s)
  			""" % ','.join('?' for x in ids)
  		self.db.execute(query, ids)
  
  		return messages
docs: Ugly, but will work with sqlite3 or pysqlite2