0.1.43
not parse airports wo city
This commit is contained in:
@@ -58,7 +58,7 @@ def create_airports_by_airportsList(airportsList, city=None):
|
|||||||
kwargs.update({'iata_code': airport_Dict['iata']})
|
kwargs.update({'iata_code': airport_Dict['iata']})
|
||||||
airport = Airport.objects.get(**kwargs)
|
airport = Airport.objects.get(**kwargs)
|
||||||
except Airport.DoesNotExist:
|
except Airport.DoesNotExist:
|
||||||
print(f'{airport_Dict["int_name"]} не найден в БД > добавляем')
|
print(f' - - {airport_Dict["int_name"]} не найден в БД > добавляем')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f'error = {str(e)}')
|
print(f'error = {str(e)}')
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ def parse_data():
|
|||||||
try:
|
try:
|
||||||
city = City.objects.get(**kwargs)
|
city = City.objects.get(**kwargs)
|
||||||
except City.DoesNotExist:
|
except City.DoesNotExist:
|
||||||
print(f'{city_Dict["name:en"]} не найдена в БД > добавляем')
|
print(f' - {city_Dict["name:en"]} не найдена в БД > добавляем')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f'error = {str(e)}')
|
print(f'error = {str(e)}')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user