Commit a25f9712 authored by Dominik Rosiek's avatar Dominik Rosiek

pollutions with html

parent 9cc8b4b0
...@@ -263,7 +263,8 @@ class DDBtypes(DDBTable): ...@@ -263,7 +263,8 @@ class DDBtypes(DDBTable):
'unit': DDBStringField, 'unit': DDBStringField,
'norm': DDBIntField, 'norm': DDBIntField,
'longname': DDBStringField, 'longname': DDBStringField,
'description': DDBStringField 'description': DDBStringField,
'html': DDBStringField,
} }
@gen.coroutine @gen.coroutine
...@@ -273,7 +274,8 @@ class DDBtypes(DDBTable): ...@@ -273,7 +274,8 @@ class DDBtypes(DDBTable):
'unit': pollution_type.unit, 'unit': pollution_type.unit,
'norm': pollution_type.norm, 'norm': pollution_type.norm,
'longname': pollution_type.longname, 'longname': pollution_type.longname,
'description': pollution_type.description 'description': pollution_type.description,
'html': pollution_type.html
} }
message = yield gen.Task(self._dynamodb(operation='UpdateItem').call, message = yield gen.Task(self._dynamodb(operation='UpdateItem').call,
......
...@@ -54,13 +54,14 @@ class Station(DDBobject): ...@@ -54,13 +54,14 @@ class Station(DDBobject):
class Type(DDBobject): class Type(DDBobject):
stored = {} stored = {}
def __init__(self, shortname, unit, norm, longname, description, type_id=None): def __init__(self, shortname, unit, norm, longname, description, html, type_id=None):
self.id = type_id or str(uuid.uuid4()) self.id = type_id or str(uuid.uuid4())
self.shortname = shortname self.shortname = shortname
self.unit = unit self.unit = unit
self.norm = norm self.norm = norm
self.longname = longname self.longname = longname
self.description = description self.description = description
self.html = html
@classmethod @classmethod
@coroutine @coroutine
......
...@@ -14,7 +14,7 @@ def main(): ...@@ -14,7 +14,7 @@ def main():
for row in reader: for row in reader:
uuid = UUID(int=int(row[0])) uuid = UUID(int=int(row[0]))
station = models.Type(shortname=row[1], longname=row[2], description=row[2], norm=row[5], unit=row[4], station = models.Type(shortname=row[1], longname=row[2], description=row[2], norm=row[5], unit=row[4],
type_id=uuid) type_id=uuid, html=row[3])
result = yield station.save() result = yield station.save()
IOLoop.current().run_sync(main) IOLoop.current().run_sync(main)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment