Commit a25f9712 authored by Dominik Rosiek's avatar Dominik Rosiek

pollutions with html

parent 9cc8b4b0
......@@ -263,7 +263,8 @@ class DDBtypes(DDBTable):
'unit': DDBStringField,
'norm': DDBIntField,
'longname': DDBStringField,
'description': DDBStringField
'description': DDBStringField,
'html': DDBStringField,
}
@gen.coroutine
......@@ -273,7 +274,8 @@ class DDBtypes(DDBTable):
'unit': pollution_type.unit,
'norm': pollution_type.norm,
'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,
......
......@@ -54,13 +54,14 @@ class Station(DDBobject):
class Type(DDBobject):
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.shortname = shortname
self.unit = unit
self.norm = norm
self.longname = longname
self.description = description
self.html = html
@classmethod
@coroutine
......
......@@ -14,7 +14,7 @@ def main():
for row in reader:
uuid = UUID(int=int(row[0]))
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()
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