Преглед изворни кода

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:
             for row in db_data:
                 # print(row)
                 # print(row)
                 if (
                 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
                         scratching.horse == row.horse
                 ):
                 ):
                     message = 'Horse found: date = {}, venue = {}, race = {}, horse = {}'.format(scratching.date,
                     message = 'Horse found: date = {}, venue = {}, race = {}, horse = {}'.format(scratching.date,