This commit is contained in:
2025-05-27 04:23:51 -05:00
parent f4bcf72b9b
commit 381f78b4e2
12 changed files with 282 additions and 79 deletions

View File

@ -41,4 +41,15 @@ class Plant(db.Model):
updates = db.relationship('PlantUpdate', backref='growlog', lazy=True)
lineage = db.relationship('PlantLineage', backref='child', lazy=True, foreign_keys='PlantLineage.child_plant_id')
tags = db.relationship('Tag', secondary=plant_tags, backref='plants')
# → relationships so we can pull in the actual names:
common_name = db.relationship(
'PlantCommonName',
backref=db.backref('plants', lazy='dynamic'),
lazy=True
)
scientific_name = db.relationship(
'PlantScientificName',
backref=db.backref('plants', lazy='dynamic'),
lazy=True
)