Jelajahi Sumber

Dtabase stores date object. Comapare dates with strftime

Foppe Hemminga 6 tahun lalu
induk
melakukan
f2fd4f5892
1 mengubah file dengan 3 tambahan dan 3 penghapusan
  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,