more
This commit is contained in:
@ -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
|
||||
)
|
Reference in New Issue
Block a user