mirror of
https://github.com/gmbrax/Pilgrim.git
synced 2026-11-09 18:30:19 +00:00
Added a Back Relationship in Entry to list all the photos
This commit is contained in:
parent
5e28f63cb8
commit
4814712039
@@ -1,4 +1,5 @@
|
|||||||
from sqlalchemy import Column, Integer, String, ForeignKey, Table
|
from sqlalchemy import Column, Integer, String, ForeignKey, Table
|
||||||
|
from sqlalchemy.orm import relationship
|
||||||
|
|
||||||
from Pilgrim import Base
|
from Pilgrim import Base
|
||||||
|
|
||||||
@@ -15,4 +16,8 @@ class Entry(Base):
|
|||||||
title = Column(String)
|
title = Column(String)
|
||||||
text = Column(String)
|
text = Column(String)
|
||||||
date = Column(String)
|
date = Column(String)
|
||||||
|
photos = relationship(
|
||||||
|
"Photo",
|
||||||
|
secondary=photo_entry_association,
|
||||||
|
back_populates="entries")
|
||||||
fk_TravelDiary_id = Column(Integer, ForeignKey("TravelDiary.id"))
|
fk_TravelDiary_id = Column(Integer, ForeignKey("TravelDiary.id"))
|
||||||
|
|||||||
Reference in New Issue
Block a user