diff options
author | emkael <emkael@tlen.pl> | 2017-10-02 23:15:45 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2017-10-02 23:15:45 +0200 |
commit | edd1b14394d5c5fe1993e043352d7876273858e3 (patch) | |
tree | d0504563e21d22d5cf28d41c85c17bc8b99954a7 /ausbutler | |
parent | 6f4af30fec1cc6464f0234e37a83ab16e4e16fc6 (diff) |
On butler continuation, exclude records for players which are not on player list for current event (e.g. when events split)
Diffstat (limited to 'ausbutler')
-rw-r--r-- | ausbutler/interface.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ausbutler/interface.py b/ausbutler/interface.py index 984b59b..eb08a6f 100644 --- a/ausbutler/interface.py +++ b/ausbutler/interface.py @@ -42,9 +42,9 @@ class Interface(object): self.session.query(AusButler).delete() if Constants.oldbutler is not None: old_bulter_query = text( - 'SELECT * FROM %s.butler' % Constants.oldbutler) + 'SELECT * FROM %s.butler WHERE id IN (SELECT id FROM players)' % Constants.oldbutler) old_normbutler_query = text( - 'SELECT id, SUM(cut_score), SUM(corrected_score) FROM %s.aus_butler GROUP BY id' % Constants.oldbutler + 'SELECT id, SUM(cut_score), SUM(corrected_score) FROM %s.aus_butler WHERE id IN (SELECT id FROM players) GROUP BY id' % Constants.oldbutler ) try: old_normbutler = self.session.execute(old_normbutler_query) |