changes
This commit is contained in:
15
plugins/growlog/models.py
Normal file
15
plugins/growlog/models.py
Normal file
@ -0,0 +1,15 @@
|
||||
from app import db
|
||||
from datetime import datetime
|
||||
|
||||
class GrowLog(db.Model):
|
||||
__tablename__ = 'grow_logs'
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
plant_id = db.Column(db.Integer, db.ForeignKey('plants.id'), nullable=False)
|
||||
timestamp = db.Column(db.DateTime, default=datetime.utcnow)
|
||||
event_type = db.Column(db.String(64), nullable=False)
|
||||
note = db.Column(db.Text)
|
||||
|
||||
media = db.relationship("Media", backref="growlog", lazy=True)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<GrowLog {self.event_type} @ {self.timestamp}>"
|
Reference in New Issue
Block a user