Skip to content

Commit

Permalink
Fix 'select()' method.
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Jan 27, 2017
1 parent abd7a72 commit d55a2e5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions genibus/devices/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,11 @@ def close(self):
self.cursor.close()
self.conn.close()

def select(self, table):
self.cursor.execute("SELECT * FROM {0};".format(table))
def select(self, model):
self.cursor.execute("SELECT * FROM dataitems WHERE model = ? ORDER BY class, id;", (model, ))
result = self.cursor.fetchall();
return result

#db = DeviceDB()
#pprint(db.select("dataitems"))
#db.close()
db = DeviceDB()
#pprint(db.select("upe"))

0 comments on commit d55a2e5

Please sign in to comment.