Fix begin and end in select_openweatherdata_grouped.
[chrisu/seepark.git] / web / seepark_web.py
index 42bbf30740db0f42292f89901d432b5611f382e6..0870a12061715662f61501eb31b935e22a50ff5c 100644 (file)
@@ -134,8 +134,8 @@ def select_openweatherdata_grouped(cityid, begin, end):
             func.avg(OpenWeatherMap.temp).label('temp'),
             OpenWeatherMap.cityid)
     OpenWeatherMap.query.filter(OpenWeatherMap.cityid == cityid)
-    query = query.filter(Sensors.timestamp >= begin)
-    query = query.filter(Sensors.timestamp <= end)
+    query = query.filter(OpenWeatherMap.datetime >= begin)
+    query = query.filter(OpenWeatherMap.datetime <= end)
     query = query.group_by('g', OpenWeatherMap.cityid)
     return query.all()