working, images broken
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
from uuid import uuid4
|
||||
import os
|
||||
from sqlalchemy.orm import joinedload
|
||||
|
||||
from flask import (
|
||||
Blueprint,
|
||||
render_template,
|
||||
@ -10,6 +12,7 @@ from flask import (
|
||||
current_app,
|
||||
)
|
||||
from flask_login import login_required, current_user
|
||||
|
||||
from app import db
|
||||
from .models import Plant, PlantCommonName, PlantScientificName
|
||||
from .forms import PlantForm
|
||||
@ -37,7 +40,9 @@ def inject_image_helper():
|
||||
@login_required
|
||||
def index():
|
||||
plants = (
|
||||
Plant.query.filter_by(owner_id=current_user.id)
|
||||
Plant.query
|
||||
.options(joinedload(Plant.media_items))
|
||||
.filter_by(owner_id=current_user.id)
|
||||
.order_by(Plant.id.desc())
|
||||
.all()
|
||||
)
|
||||
|
Reference in New Issue
Block a user