def show_plant_details(plant_id):
"""Show individual plant's page"""
found_plant = Plant.query.get(plant_id)
if not found_plant.image:
found_plant.image = "/static/img/placeholder-image.png"
db.session.commit()
found_plant = found_plant.__dict__
if '_sa_instance_state' in found_plant:
del found_plant['_sa_instance_state']
return jsonify(found_plant)
评论列表
文章目录