TOURNEY: record added/addedCurrency

This commit is contained in:
steffen123 2010-07-17 02:35:02 +02:00
parent 90ceafda6d
commit 656986826f
2 changed files with 8 additions and 20 deletions

View File

@ -1984,27 +1984,13 @@ class Database:
) )
result=cursor.fetchone() result=cursor.fetchone()
expectedValues = { 1 : "buyin", 2 : "fee", 4 : "isKO", 5 : "isRebuy", 6 : "speed", if result:
7 : "isShootout", 8 : "isMatrix" }
tourneyTypeIdMatch = True
try:
tourneyTypeId = result[0] tourneyTypeId = result[0]
log.debug("Tourney found in db with Tourney_Type_ID = %d" % tourneyTypeId) else:
for ev in expectedValues :
if ( getattr( hand, expectedValues.get(ev) ) <> result[ev] ):
log.debug("TypeId mismatch : wrong %s : Tourney=%s / db=%s" % (expectedValues.get(ev), getattr( hand, expectedValues.get(ev)), result[ev]) )
tourneyTypeIdMatch = False
#break
except:
# Tourney not found : a TourneyTypeId has to be found or created for that specific tourney
tourneyTypeIdMatch = False
if tourneyTypeIdMatch == False :
# Check for an existing TTypeId that matches tourney info, if not found create it # Check for an existing TTypeId that matches tourney info, if not found create it
cursor.execute (self.sql.query['getTourneyTypeId'].replace('%s', self.sql.query['placeholder']), cursor.execute (self.sql.query['getTourneyTypeId'].replace('%s', self.sql.query['placeholder']),
(hand.siteId, hand.buyinCurrency, hand.buyin, hand.fee, hand.gametype['category'], hand.gametype['limitType'], hand.isKO, (hand.siteId, hand.buyinCurrency, hand.buyin, hand.fee, hand.gametype['category'], hand.gametype['limitType'], hand.isKO,
hand.isRebuy, hand.isRebuy, hand.speed, hand.isShootout, hand.isMatrix) hand.isRebuy, hand.isRebuy, hand.speed, hand.isShootout, hand.isMatrix, hand.added, hand.addedCurrency)
) )
result=cursor.fetchone() result=cursor.fetchone()
@ -2014,7 +2000,7 @@ class Database:
cursor.execute (self.sql.query['insertTourneyType'].replace('%s', self.sql.query['placeholder']), cursor.execute (self.sql.query['insertTourneyType'].replace('%s', self.sql.query['placeholder']),
(hand.siteId, hand.buyinCurrency, hand.buyin, hand.fee, hand.gametype['category'], hand.gametype['limitType'], hand.buyInChips, (hand.siteId, hand.buyinCurrency, hand.buyin, hand.fee, hand.gametype['category'], hand.gametype['limitType'], hand.buyInChips,
hand.isKO, hand.isRebuy, hand.isKO, hand.isRebuy,
hand.isAddOn, hand.speed, hand.isShootout, hand.isMatrix) hand.isAddOn, hand.speed, hand.isShootout, hand.isMatrix, hand.added, hand.addedCurrency)
) )
tourneyTypeId = self.get_last_insert_id(cursor) tourneyTypeId = self.get_last_insert_id(cursor)
return tourneyTypeId return tourneyTypeId

View File

@ -3698,12 +3698,14 @@ class Sql:
AND speed=%s AND speed=%s
AND shootout=%s AND shootout=%s
AND matrix=%s AND matrix=%s
AND added=%s
AND addedCurrency=%s
""" """
self.query['insertTourneyType'] = """INSERT INTO TourneyTypes self.query['insertTourneyType'] = """INSERT INTO TourneyTypes
(siteId, currency, buyin, fee, category, limitType, buyInChips, knockout, rebuy, (siteId, currency, buyin, fee, category, limitType, buyInChips, knockout, rebuy,
addOn ,speed, shootout, matrix) addOn ,speed, shootout, matrix, added, addedCurrency)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
""" """
self.query['getTourneyByTourneyNo'] = """SELECT t.* self.query['getTourneyByTourneyNo'] = """SELECT t.*