mirror of https://github.com/gmbrax/Pilgrim.git
Fix all imports to be absolute and not relative
This commit is contained in:
parent
78e45e26fd
commit
06ee08b201
|
|
@ -29,6 +29,10 @@ class Database:
|
||||||
self._session_maker = sessionmaker(bind=self.engine, autoflush=False, autocommit=False)
|
self._session_maker = sessionmaker(bind=self.engine, autoflush=False, autocommit=False)
|
||||||
|
|
||||||
def create(self):
|
def create(self):
|
||||||
|
# ADICIONE ESTAS 3 LINHAS AQUI
|
||||||
|
print("\n--- [DIAGNÓSTICO DA APLICAÇÃO] ---")
|
||||||
|
print("Tabelas que a Base conhece:", sorted(list(Base.metadata.tables.keys())))
|
||||||
|
print("----------------------------------")
|
||||||
Base.metadata.create_all(self.engine)
|
Base.metadata.create_all(self.engine)
|
||||||
|
|
||||||
def session(self):
|
def session(self):
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@ from pilgrim.models.photo_in_entry import photo_entry_association
|
||||||
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime
|
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime
|
||||||
from sqlalchemy.orm import relationship
|
from sqlalchemy.orm import relationship
|
||||||
|
|
||||||
from ..database import Base
|
from pilgrim.database import Base
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Entry(Base):
|
class Entry(Base):
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,8 @@ from sqlalchemy.orm import relationship
|
||||||
from sqlalchemy.sql.schema import Index
|
from sqlalchemy.sql.schema import Index
|
||||||
|
|
||||||
from pilgrim.models.photo_in_entry import photo_entry_association
|
from pilgrim.models.photo_in_entry import photo_entry_association
|
||||||
from ..database import Base
|
from pilgrim.database import Base
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Photo(Base):
|
class Photo(Base):
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
from sqlalchemy import Table, Column, Integer, ForeignKey
|
from sqlalchemy import Table, Column, Integer, ForeignKey
|
||||||
|
|
||||||
from ..database import Base
|
from pilgrim.database import Base
|
||||||
|
|
||||||
photo_entry_association = Table('photo_entry_association', Base.metadata,
|
photo_entry_association = Table('photo_entry_association', Base.metadata,
|
||||||
Column('id', Integer, primary_key=True, autoincrement=True),
|
Column('id', Integer, primary_key=True, autoincrement=True),
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,11 @@ from typing import Any
|
||||||
from sqlalchemy import Column, Integer, String, UniqueConstraint
|
from sqlalchemy import Column, Integer, String, UniqueConstraint
|
||||||
from sqlalchemy.orm import relationship
|
from sqlalchemy.orm import relationship
|
||||||
|
|
||||||
from .. import database
|
from pilgrim.database import Base
|
||||||
|
|
||||||
|
|
||||||
class TravelDiary(database.Base):
|
|
||||||
|
class TravelDiary(Base):
|
||||||
__tablename__ = "travel_diaries"
|
__tablename__ = "travel_diaries"
|
||||||
id = Column(Integer, primary_key=True)
|
id = Column(Integer, primary_key=True)
|
||||||
name = Column(String, nullable=False)
|
name = Column(String, nullable=False)
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from ..models.entry import Entry
|
from pilgrim.models.entry import Entry
|
||||||
from ..models.travel_diary import TravelDiary
|
from pilgrim.models.travel_diary import TravelDiary
|
||||||
from ..models.photo import Photo # ✨ Importe o modelo Photo
|
from pilgrim.models.photo import Photo # ✨ Importe o modelo Photo
|
||||||
|
|
||||||
|
|
||||||
class EntryService:
|
class EntryService:
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ from pathlib import Path
|
||||||
from pilgrim.utils import DirectoryManager
|
from pilgrim.utils import DirectoryManager
|
||||||
from sqlalchemy.exc import IntegrityError
|
from sqlalchemy.exc import IntegrityError
|
||||||
|
|
||||||
from ..models.travel_diary import TravelDiary
|
from pilgrim.models.travel_diary import TravelDiary
|
||||||
|
|
||||||
|
|
||||||
class TravelDiaryService:
|
class TravelDiaryService:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue