Convert dict key to string to prevent an error (on rigel).
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Wed, 22 Aug 2018 20:32:23 +0000 (22:32 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Wed, 22 Aug 2018 20:33:01 +0000 (22:33 +0200)
web/seepark_web.py

index 238be549247c36bc6739318fcd29212f7dd52b9c..368f208f9e79cfbe800d0f8165fdc6c8c68a0fc3 100644 (file)
@@ -140,7 +140,7 @@ def select_openweatherdata(cityid, begin, end, mode):
 def convert_to_c3(result, id, field_x, field_y):
     c3result = defaultdict(list)
     for row in result:
 def convert_to_c3(result, id, field_x, field_y):
     c3result = defaultdict(list)
     for row in result:
-        c3result[getattr(row, id)].append(getattr(row, field_y))
+        c3result[str(getattr(row, id))].append(getattr(row, field_y))
         dt = getattr(row, field_x).strftime('%Y-%m-%d %H:%M:%S')
         c3result[str(getattr(row, id)) + '_x'].append(dt)
     return c3result
         dt = getattr(row, field_x).strftime('%Y-%m-%d %H:%M:%S')
         c3result[str(getattr(row, id)) + '_x'].append(dt)
     return c3result