mirror of
https://github.com/gmbrax/Pilgrim.git
synced 2026-11-09 17:20:17 +00:00
Added the photo_service.py and modified photo.py to have all the crud operations
This commit is contained in:
parent
8ad57b548f
commit
7e29a590a2
@@ -1,3 +1,5 @@
|
||||
from typing import Any
|
||||
|
||||
from sqlalchemy import Column, Integer, String
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
@@ -12,8 +14,16 @@ class Photo(Base):
|
||||
name = Column(String)
|
||||
addition_date = Column(String)
|
||||
caption = Column(String)
|
||||
entries = relationship(
|
||||
entries:relationship = relationship(
|
||||
"Entry",
|
||||
secondary=photo_entry_association,
|
||||
back_populates="photos"
|
||||
)
|
||||
def __init__(self, filepath, name, addition_date=None, caption=None, entries=None, **kw: Any):
|
||||
super().__init__(**kw)
|
||||
self.filepath = filepath
|
||||
self.name = name
|
||||
self.addition_date = addition_date
|
||||
self.caption = caption
|
||||
self.entries = entries
|
||||
|
||||
|
||||
Reference in New Issue
Block a user