improve naming of replacement clauses

This commit is contained in:
steffen123 2010-08-11 04:23:16 +02:00
parent b385f9f0da
commit 5cba225fb3
2 changed files with 9 additions and 9 deletions

View File

@ -1451,8 +1451,8 @@ class Database:
+ " or ( hp.playerId in " + str(tuple(self.hero_ids.values())) \ + " or ( hp.playerId in " + str(tuple(self.hero_ids.values())) \
+ " and h.startTime > '" + h_start + "'))" \ + " and h.startTime > '" + h_start + "'))" \
+ " AND hp.tourneysPlayersId IS NULL)" + " AND hp.tourneysPlayersId IS NULL)"
rebuild_sql_cash = self.sql.query['rebuildHudCache'].replace('<tourney1_clause>', "") rebuild_sql_cash = self.sql.query['rebuildHudCache'].replace('<tourney_insert_clause>', "")
rebuild_sql_cash = rebuild_sql_cash.replace('<tourney2_clause>', "") rebuild_sql_cash = rebuild_sql_cash.replace('<tourney_select_clause>', "")
rebuild_sql_cash = rebuild_sql_cash.replace('<tourney_join_clause>', "") rebuild_sql_cash = rebuild_sql_cash.replace('<tourney_join_clause>', "")
rebuild_sql_cash = rebuild_sql_cash.replace('<tourney_group_clause>', "") rebuild_sql_cash = rebuild_sql_cash.replace('<tourney_group_clause>', "")
rebuild_sql_cash = rebuild_sql_cash.replace('<where_clause>', where) rebuild_sql_cash = rebuild_sql_cash.replace('<where_clause>', where)
@ -1468,13 +1468,13 @@ class Database:
+ " or ( hp.playerId in " + str(tuple(self.hero_ids.values())) \ + " or ( hp.playerId in " + str(tuple(self.hero_ids.values())) \
+ " and h.startTime > '" + h_start + "'))" \ + " and h.startTime > '" + h_start + "'))" \
+ " AND hp.tourneysPlayersId >= 0)" + " AND hp.tourneysPlayersId >= 0)"
rebuild_sql_tourney = self.sql.query['rebuildHudCache'].replace('<tourney1_clause>', ",tourneyTypeId") rebuild_sql_tourney = self.sql.query['rebuildHudCache'].replace('<tourney_insert_clause>', ",tourneyTypeId")
rebuild_sql_tourney = rebuild_sql_tourney.replace('<tourney2_clause>', ",t.tourneyTypeId") rebuild_sql_tourney = rebuild_sql_tourney.replace('<tourney_select_clause>', ",t.tourneyTypeId")
rebuild_sql_tourney = rebuild_sql_tourney.replace('<tourney_join_clause>', """INNER JOIN TourneysPlayers tp ON (tp.id = hp.tourneysPlayersId) rebuild_sql_tourney = rebuild_sql_tourney.replace('<tourney_join_clause>', """INNER JOIN TourneysPlayers tp ON (tp.id = hp.tourneysPlayersId)
INNER JOIN Tourneys t ON (t.id = tp.tourneyId)""") INNER JOIN Tourneys t ON (t.id = tp.tourneyId)""")
rebuild_sql_tourney = rebuild_sql_tourney.replace('<tourney_group_clause>', ",t.tourneyTypeId") rebuild_sql_tourney = rebuild_sql_tourney.replace('<tourney_group_clause>', ",t.tourneyTypeId")
rebuild_sql_tourney = rebuild_sql_tourney.replace('<where_clause>', where) rebuild_sql_tourney = rebuild_sql_tourney.replace('<where_clause>', where)
#print "rebuild_sql_tourney:",rebuild_sql_tourney print "rebuild_sql_tourney:",rebuild_sql_tourney
self.get_cursor().execute(rebuild_sql_tourney) self.get_cursor().execute(rebuild_sql_tourney)
self.commit() self.commit()

View File

@ -2990,7 +2990,7 @@ class Sql:
,playerId ,playerId
,activeSeats ,activeSeats
,position ,position
<tourney1_clause> <tourney_insert_clause>
,styleKey ,styleKey
,HDs ,HDs
,wonWhenSeenStreet1 ,wonWhenSeenStreet1
@ -3080,7 +3080,7 @@ class Sql:
when hp.position = '9' then 'E' when hp.position = '9' then 'E'
else 'E' else 'E'
end AS hc_position end AS hc_position
<tourney2_clause> <tourney_select_clause>
,date_format(h.startTime, 'd%y%m%d') ,date_format(h.startTime, 'd%y%m%d')
,count(1) ,count(1)
,sum(wonWhenSeenStreet1) ,sum(wonWhenSeenStreet1)
@ -3346,7 +3346,7 @@ class Sql:
,playerId ,playerId
,activeSeats ,activeSeats
,position ,position
<tourney1_clause> <tourney_insert_clause>
,styleKey ,styleKey
,HDs ,HDs
,wonWhenSeenStreet1 ,wonWhenSeenStreet1
@ -3436,7 +3436,7 @@ class Sql:
when hp.position = '9' then 'E' when hp.position = '9' then 'E'
else 'E' else 'E'
end AS hc_position end AS hc_position
<tourney2_clause> <tourney_select_clause>
,'d' || substr(strftime('%Y%m%d', h.startTime),3,7) ,'d' || substr(strftime('%Y%m%d', h.startTime),3,7)
,count(1) ,count(1)
,sum(wonWhenSeenStreet1) ,sum(wonWhenSeenStreet1)