mirror of https://github.com/gmbrax/Pilgrim.git
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.orm import relationship
|
||||
|
||||
from Pilgrim import Base
|
||||
|
||||
|
|
@ -15,4 +16,8 @@ class Entry(Base):
|
|||
title = Column(String)
|
||||
text = Column(String)
|
||||
date = Column(String)
|
||||
photos = relationship(
|
||||
"Photo",
|
||||
secondary=photo_entry_association,
|
||||
back_populates="entries")
|
||||
fk_TravelDiary_id = Column(Integer, ForeignKey("TravelDiary.id"))
|
||||
|
|
|
|||
Loading…
Reference in New Issue