Beispiel #1
0
 def get_by_wineid(self, wineid):
     sql = ("SELECT * FROM winesdb.wines"
            " WHERE wineid=%s")
     params = (wineid, )
     self.cursor.execute(sql, params)
     res = self.cursor.fetchone()
     return mysqldb_util.convert_to_json(res)
Beispiel #2
0
 def get_by_name(self, name):
     sql = ("SELECT * FROM winesdb.wines"
            " WHERE name=%s")
     params = (name, )
     self.cursor.execute(sql, params)
     res = self.cursor.fetchone()
     return mysqldb_util.convert_to_json(res)