Skip to content

Commit e2994ef

Browse files
committed
20190402
1 parent aab10be commit e2994ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

WeatherMonitor/weather_getter.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ def save_aqi(city_name, site_name, aqi, main, pm10, pm25, no2, so2, co, o3):
7979

8080
key = get_key()
8181

82-
83-
crawling_times = Weather.select().where((Weather.date == datetime.datetime.now().date()) & (Weather.city_code == '长春')).count()
82+
city_code = City.select().where(City.city_name == '长春').get()
83+
crawling_times = Weather.select().where((Weather.date == datetime.datetime.now().date()) & (Weather.city_code == city_code)).count()
8484
if crawling_times ==0:
8585
today_tmp_max, today_tmp_min = get_temp(key, 'changchun')
8686
save_temp('长春', today_tmp_max, today_tmp_min)

0 commit comments

Comments
 (0)