diff options
Diffstat (limited to 'ebus')
-rw-r--r-- | ebus/web/model.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ebus/web/model.py b/ebus/web/model.py index 04b15ed..7e21e82 100644 --- a/ebus/web/model.py +++ b/ebus/web/model.py @@ -41,8 +41,8 @@ class Value(ModelBase): def value(self): raise NotImplementedException() -class ValueInt(Value): - __mapper_args__ = {'polymorphic_identity': 'value'} +class ValueFloat(Value): + __mapper_args__ = {'polymorphic_identity': 'float'} value_float = Column(Float(precision=4)) def __init__(self, sensor, value, timestamp=datetime.now()): @@ -53,7 +53,7 @@ class ValueInt(Value): return self.value_float class ValueInt(Value): - __mapper_args__ = {'polymorphic_identity': 'value'} + __mapper_args__ = {'polymorphic_identity': 'int'} value_int = Column(Integer) def __init__(self, sensor, value, timestamp=datetime.now()): @@ -64,12 +64,12 @@ class ValueInt(Value): return self.value_int class ValueString(Value): - __mapper_args__ = {'polymorphic_identity': 'value'} + __mapper_args__ = {'polymorphic_identity': 'string'} value_string = Column(String) def __init__(self, sensor, value, timestamp=datetime.now()): Value.__init__(self, sensor, timestamp) - self.value_int = value + self.value_string = value def value(self): return self.value_string |