powermeter/app/models/impulse.py

13 lines
382 B
Python
Raw Normal View History

2021-01-24 13:58:29 +01:00
from .. import db
from datetime import datetime
class Impulse(db.Model):
id = db.Column(db.Integer, primary_key=True)
power = db.Column(db.Integer, nullable=False)
created_at = db.Column(db.DateTime, default=datetime.now, nullable=False)
def __repr__(self):
return 'Impulse {} with power of {} watts at {}'.format(self.name, self.power, self.created_at)