|
|
@@ -61,20 +61,26 @@ if __name__ == '__main__':
|
|
|
# print(row)
|
|
|
# if type(row) == 'datetime.time':
|
|
|
# continue
|
|
|
- if (
|
|
|
- scratching.date == row.race_date.strftime('%Y-%m-%d') and
|
|
|
- scratching.venue == row.venue and
|
|
|
- int(scratching.race) == int(row.race) and
|
|
|
- scratching.horse == row.horse
|
|
|
- ):
|
|
|
- message_string = 'Horse found: date = {}, venue = {}, race = {}, horse = {}'
|
|
|
- message = message_string.format(scratching.date,
|
|
|
- scratching.venue,
|
|
|
- scratching.race,
|
|
|
- scratching.horse)
|
|
|
- # print(message)
|
|
|
- # print(row)
|
|
|
- found_in_database = True
|
|
|
+ try:
|
|
|
+ if (
|
|
|
+ scratching.date == row.race_date.strftime('%Y-%m-%d') and
|
|
|
+ scratching.venue == row.venue and
|
|
|
+ int(scratching.race) == int(row.race) and
|
|
|
+ scratching.horse == row.horse
|
|
|
+ ):
|
|
|
+ message_string = 'Horse found: date = {}, venue = {}, race = {}, horse = {}'
|
|
|
+ message = message_string.format(scratching.date,
|
|
|
+ scratching.venue,
|
|
|
+ scratching.race,
|
|
|
+ scratching.horse)
|
|
|
+ # print(message)
|
|
|
+ # print(row)
|
|
|
+ found_in_database = True
|
|
|
+ except AttributeError as ae:
|
|
|
+ print(ae)
|
|
|
+ print('row: ', end='')
|
|
|
+ print(row)
|
|
|
+ continue
|
|
|
if not found_in_database:
|
|
|
# report new scratching
|
|
|
date_object = datetime.datetime.strptime(scratching.date, "%Y-%m-%d").date()
|