working, images broken
This commit is contained in:
@ -101,14 +101,14 @@ class Plant(db.Model):
|
||||
media_items = db.relationship(
|
||||
'plugins.media.models.Media',
|
||||
back_populates='plant',
|
||||
lazy='dynamic',
|
||||
lazy='select', # ← this is the fix
|
||||
cascade='all, delete-orphan',
|
||||
foreign_keys='plugins.media.models.Media.plant_id'
|
||||
)
|
||||
|
||||
@property
|
||||
def media(self):
|
||||
return self.media_items.all()
|
||||
return self.media_items # already a list when lazy='select'
|
||||
|
||||
# the one you see on the detail page
|
||||
featured_media = db.relationship(
|
||||
|
Reference in New Issue
Block a user