get_updated_countries(res):
countries_updated = make_countries_list(res)
for country_updated in countries_updated:
try:
country = Country.objects.get(title=country_updated['name'])
country.new_country_id = country_updated['id']
country.is_updated = 1
country.save()
except country.DoesNotExist:
country = Country(country_id=country_updated['id'], new_country_id=country_updated['id'],
title=country_updated['name'], is_updated=1)
country.save()
print("Country {} has been added to the database".format(country_updated['name']))
Выдаёт;) ты просто не видел)
Обсуждают сегодня