HUD: make update_hudcache data INT not BOOL (#93) & rushaux BOOL fix

This commit is contained in:
gimick 2011-03-20 17:57:07 +00:00
parent f0798111e5
commit b0ea975b25
2 changed files with 9 additions and 1 deletions

View File

@ -2054,6 +2054,14 @@ class Database:
cursor = self.get_cursor()
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:
num = cursor.execute(update_hudcache, row)
#print "DEBUG: values: %s" % row[-6:]

View File

@ -243,7 +243,7 @@ class RushNotes(Aux_Window):
c.execute(("SELECT handId, position, startCards, street0Aggr, tableName " +
"FROM Hands, HandsPlayers " +
"WHERE HandsPlayers.handId = Hands.id " +
"AND street0VPI = 1 " +
"AND street0VPI = True " +
"AND startCards > 0 " +
"AND playerId = %d " +
"ORDER BY startCards DESC " +