瀏覽代碼

Dtabase stores date object. Comapare dates with strftime

Foppe Hemminga 6 年之前
父節點
當前提交
f2fd4f5892
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      main.py

+ 3 - 3
main.py

@@ -58,9 +58,9 @@ if __name__ == '__main__':
             for row in db_data:
                 # print(row)
                 if (
-                        # scratching.date == row.race_date and
-                        # scratching.venue == row.venue and
-                        # scratching.race == row.race and
+                        scratching.date == row.race_date.strftime('%Y-%m-%d') and
+                        scratching.venue == row.venue and
+                        scratching.race == row.race and
                         scratching.horse == row.horse
                 ):
                     message = 'Horse found: date = {}, venue = {}, race = {}, horse = {}'.format(scratching.date,