mirror of https://github.com/gmbrax/Pilgrim.git
Merge pull request #61 from gmbrax/fix/relative-imports
Fix/relative imports
This commit is contained in:
commit
4d87ae1b90
|
|
@ -1,36 +1,31 @@
|
|||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "pilgrim"
|
||||
version = "0.0.4"
|
||||
authors = [
|
||||
{ name="Gustavo Henrique Santos Souza de Miranda", email="gustavohssmiranda@gmail.com" }
|
||||
]
|
||||
description = "Pilgrim's Travel Log"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
classifiers = [
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: OSI Approved :: BSD License",
|
||||
"Operating System :: OS Independent",
|
||||
]
|
||||
dependencies = [
|
||||
"sqlalchemy",
|
||||
"textual",
|
||||
"tomli",
|
||||
"tomli_w"
|
||||
]
|
||||
|
||||
[project]
|
||||
name = "Pilgrim"
|
||||
version = "0.0.4"
|
||||
authors = [
|
||||
{ name="Gustavo Henrique Santos Souza de Miranda", email="gustavohssmiranda@gmail.com" }
|
||||
]
|
||||
description = "Pilgrim's Travel Log"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
classifiers = [
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: OSI Approved :: BSD License",
|
||||
"Operating System :: OS Independent",
|
||||
]
|
||||
dependencies = [
|
||||
"sqlalchemy",
|
||||
"textual",
|
||||
"tomli",
|
||||
"tomli_w"
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/gmbrax/Pilgrim/"
|
||||
Issues = "https://github.com/gmbrax/Pilgrim/issues"
|
||||
|
||||
|
||||
]
|
||||
[template.plugins.default]
|
||||
src-layout = true
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/gmbrax/Pilgrim/"
|
||||
Issues = "https://github.com/gmbrax/Pilgrim/issues"
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/pilgrim"]
|
||||
[project.scripts]
|
||||
pilgrim = "pilgrim:main"
|
||||
[project.scripts]
|
||||
pilgrim = "pilgrim.command:main"
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.orm import declarative_base
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
from pathlib import Path
|
||||
import os
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ from pilgrim.models.photo_in_entry import photo_entry_association
|
|||
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from ..database import Base
|
||||
from pilgrim.database import Base
|
||||
|
||||
|
||||
|
||||
class Entry(Base):
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ from sqlalchemy.orm import relationship
|
|||
from sqlalchemy.sql.schema import Index
|
||||
|
||||
from pilgrim.models.photo_in_entry import photo_entry_association
|
||||
from ..database import Base
|
||||
from pilgrim.database import Base
|
||||
|
||||
|
||||
|
||||
class Photo(Base):
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
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,
|
||||
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.orm import relationship
|
||||
|
||||
from .. import database
|
||||
from pilgrim.database import Base
|
||||
|
||||
|
||||
class TravelDiary(database.Base):
|
||||
|
||||
class TravelDiary(Base):
|
||||
__tablename__ = "travel_diaries"
|
||||
id = Column(Integer, primary_key=True)
|
||||
name = Column(String, nullable=False)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
from datetime import datetime
|
||||
from typing import List
|
||||
|
||||
from ..models.entry import Entry
|
||||
from ..models.travel_diary import TravelDiary
|
||||
from ..models.photo import Photo # ✨ Importe o modelo Photo
|
||||
from pilgrim.models.entry import Entry
|
||||
from pilgrim.models.travel_diary import TravelDiary
|
||||
from pilgrim.models.photo import Photo # ✨ Importe o modelo Photo
|
||||
|
||||
|
||||
class EntryService:
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from pathlib import Path
|
|||
from pilgrim.utils import DirectoryManager
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
|
||||
from ..models.travel_diary import TravelDiary
|
||||
from pilgrim.models.travel_diary import TravelDiary
|
||||
|
||||
|
||||
class TravelDiaryService:
|
||||
|
|
|
|||
Loading…
Reference in New Issue