mirror of
https://github.com/gmbrax/Pilgrim.git
synced 2026-11-09 17:20:17 +00:00
Added the foreign key in photo.py to the travel_diary table so a photo is contained in a diary
This commit is contained in:
parent
32b8a58c3a
commit
f556d6906a
@@ -1,6 +1,6 @@
|
||||
from typing import Any
|
||||
|
||||
from sqlalchemy import Column, Integer, String
|
||||
from sqlalchemy import Column, Integer, String, ForeignKey
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from pilgrim.models.photo_in_entry import photo_entry_association
|
||||
@@ -20,6 +20,8 @@ class Photo(Base):
|
||||
back_populates="photos"
|
||||
)
|
||||
|
||||
fk_travel_diary_id = Column(Integer, ForeignKey("travel_diaries.id"))
|
||||
|
||||
def __init__(self, filepath, name, addition_date=None, caption=None, entries=None, **kw: Any):
|
||||
super().__init__(**kw)
|
||||
self.filepath = filepath
|
||||
|
||||
Reference in New Issue
Block a user