def select(self, query, data, key):
q = query
if data:
values = self._list_to_string(data)
q = q.format(values)
c = self.db.cursor()
try:
c.execute(q)
output = self._format_results(c)
if key is not None:
client = Client(base_url='http://localhost')
client.keys.update(KeyValuePair(name=key, value=str(output)))
return key
else:
return output
except MySQLdb.Error, e: # pylint: disable=no-member
raise Exception(e)
评论列表
文章目录