HUD: make update_hudcache data INT not BOOL (#93) & rushaux BOOL fix
This commit is contained in:
parent
f0798111e5
commit
b0ea975b25
|
@ -2054,6 +2054,14 @@ class Database:
|
||||||
cursor = self.get_cursor()
|
cursor = self.get_cursor()
|
||||||
|
|
||||||
for row in inserts:
|
for row in inserts:
|
||||||
|
#convert all True/False values to numeric 0/1
|
||||||
|
# needed because columns in hudcache are not BOOL they are INT
|
||||||
|
# and are being summed if an existing hudcache entry exists
|
||||||
|
# psycopg2 module does not automatically convert these to numeric.
|
||||||
|
# mantis bug #93
|
||||||
|
for ind in range(len(row)):
|
||||||
|
if row[ind] == True: row[ind] = 1
|
||||||
|
if row[ind] == False: row[ind] = 0
|
||||||
# Try to do the update first:
|
# Try to do the update first:
|
||||||
num = cursor.execute(update_hudcache, row)
|
num = cursor.execute(update_hudcache, row)
|
||||||
#print "DEBUG: values: %s" % row[-6:]
|
#print "DEBUG: values: %s" % row[-6:]
|
||||||
|
|
|
@ -243,7 +243,7 @@ class RushNotes(Aux_Window):
|
||||||
c.execute(("SELECT handId, position, startCards, street0Aggr, tableName " +
|
c.execute(("SELECT handId, position, startCards, street0Aggr, tableName " +
|
||||||
"FROM Hands, HandsPlayers " +
|
"FROM Hands, HandsPlayers " +
|
||||||
"WHERE HandsPlayers.handId = Hands.id " +
|
"WHERE HandsPlayers.handId = Hands.id " +
|
||||||
"AND street0VPI = 1 " +
|
"AND street0VPI = True " +
|
||||||
"AND startCards > 0 " +
|
"AND startCards > 0 " +
|
||||||
"AND playerId = %d " +
|
"AND playerId = %d " +
|
||||||
"ORDER BY startCards DESC " +
|
"ORDER BY startCards DESC " +
|
||||||
|
|
Loading…
Reference in New Issue
Block a user