Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 37e094e390 |
@@ -1,19 +0,0 @@
|
||||
name: Gitea Actions Demo
|
||||
run-name: ${{ gitea.actor }} ist testing out Gitea Actions
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop/0.4.0
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: inky
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
- name: List files in the directory
|
||||
run: |
|
||||
cd ${{ gitea.workspace }}/kontor-gin
|
||||
go build -o /home/tpeetz/prod/kontor cmd/kontor/main.go
|
||||
- name: List files in the directory
|
||||
run: echo "The job's status is ${{ job.status }}."
|
||||
@@ -6,9 +6,3 @@ node_modules/
|
||||
.editorconfig
|
||||
db-password.txt
|
||||
couchdb-password.txt
|
||||
kontor-robyn/kontor.db
|
||||
kontor-robyn.bak
|
||||
kontor-robyn.bak2
|
||||
kontor-data/.gradle
|
||||
kontor-data/build/
|
||||
/kontor-api/kontor-api.code-workspace
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
# Posted by barth, modified by community. See post 'Timeline' for change history
|
||||
# Retrieved 2026-08-19, License - CC BY-SA 4.0
|
||||
NEXUS_URL=https://nexus.thpeetz.de
|
||||
MAVEN_REPO=maven-snapshots
|
||||
GROUP_ID=de.thpeetz
|
||||
ARTIFACT_ID=kontor-spring
|
||||
VERSION=0.4.0
|
||||
FILE_EXTENSION=jar
|
||||
|
||||
download_url=$(curl -X GET "${NEXUS_URL}/service/rest/v1/search/assets?repository=${MAVEN_REPO}&maven.groupId=${GROUP_ID}&maven.artifactId=${ARTIFACT_ID}&maven.baseVersion=${VERSION}&maven.extension=${FILE_EXTENSION}" -H "accept: application/json" | jq -rc '.items | .[].downloadUrl' | sort | tail -n 1)
|
||||
wget $download_url
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# script/cibuild:
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
source version
|
||||
|
||||
echo " => Baue Image localhost/kontor-angular:$kontorVersion"
|
||||
buildah build -t kontor-angular:$kontorVersion kontor-angular
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
## ------------------------------- Builder Stage ------------------------------ ##
|
||||
FROM python:3.13-bookworm AS builder
|
||||
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y build-essential libpq-dev && \
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y build-essential && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Download the latest installer, install it and then remove it
|
||||
@@ -14,12 +14,13 @@ ENV PATH="/root/.local/bin:${PATH}"
|
||||
WORKDIR /app
|
||||
|
||||
COPY ./pyproject.toml .
|
||||
|
||||
RUN uv sync
|
||||
|
||||
# ------------------------------- Production Stage ------------------------------ ##
|
||||
FROM python:3.13-slim-bookworm AS production
|
||||
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y curl libpq-dev
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y curl
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# script/cibuild:
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
source version
|
||||
|
||||
echo " => Baue Image localhost/kontor-api:$kontorVersion"
|
||||
buildah build -t kontor-api:$kontorVersion kontor-api
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "kontor-api"
|
||||
version = "0.4.0"
|
||||
version = "0.1.0"
|
||||
description = "Add your description here"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.13"
|
||||
@@ -15,6 +15,7 @@ dependencies = [
|
||||
"pytest==7.4.0",
|
||||
"pyyaml>=6.0.2",
|
||||
"requests>=2.32.3",
|
||||
"sqlalchemy>=2.0.40",
|
||||
"sqlmodel>=0.0.24",
|
||||
"python-dotenv>=1.1.0",
|
||||
"python-jose[cryptography]>=3.4.0",
|
||||
@@ -23,12 +24,9 @@ dependencies = [
|
||||
"psycopg2-binary>=2.9.10",
|
||||
"pytest-cov>=6.1.1",
|
||||
"databases[sqlite]>=0.9.0",
|
||||
"pydantic[email]>=2.11.3",
|
||||
"jinja2>=3.1.6",
|
||||
"asyncpg>=0.30.0",
|
||||
"bcrypt>=4.3.0",
|
||||
"fastapi-jwt-auth>=0.5.0",
|
||||
"msgspec[toml,yaml]>=0.21.1",
|
||||
"sqlalchemy>=2.0.52",
|
||||
"pydantic[email]>=2.13.4",
|
||||
"psycopg>=3.3.6",
|
||||
]
|
||||
|
||||
@@ -18,7 +18,6 @@ from src.apis.version1.comics import (
|
||||
from src.apis.version1.media import (
|
||||
actor,
|
||||
file,
|
||||
lofi,
|
||||
mediaactorfile,
|
||||
mediavideo,
|
||||
mediaarticle,
|
||||
@@ -105,12 +104,6 @@ api_router.include_router(
|
||||
tags=["media"],
|
||||
dependencies=[Depends(get_current_user_from_token)],
|
||||
)
|
||||
api_router.include_router(
|
||||
lofi.router,
|
||||
prefix="/media",
|
||||
tags=["media"],
|
||||
dependencies=[Depends(get_current_user_from_token)],
|
||||
)
|
||||
api_router.include_router(
|
||||
mediaarticle.router,
|
||||
prefix="/media",
|
||||
|
||||
@@ -4,12 +4,7 @@ from fastapi import APIRouter, status, HTTPException
|
||||
from src.core.log_conf import logger
|
||||
from src.db.repository.media.actor import delete_mediaactor, import_mediaactor
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.media.actor import (
|
||||
MediaActorModel,
|
||||
MediaActorResponse,
|
||||
actor_to_response,
|
||||
actor_to_model
|
||||
)
|
||||
from src.schema.media.actor import MediaActorModel, MediaActorResponse, actor_to_response
|
||||
from src.db.models.media import MediaActor
|
||||
|
||||
router = APIRouter()
|
||||
@@ -31,23 +26,6 @@ def get_actor(actor_id: str, db: SessionDep) -> MediaActorResponse:
|
||||
response = actor_to_response(media_actor)
|
||||
return response
|
||||
|
||||
@router.put("/actors/{actor_id}", response_model=MediaActorResponse)
|
||||
def update_actor(actor_id: str, db:SessionDep, info: MediaActorResponse) -> MediaActorResponse:
|
||||
"""
|
||||
Update MediaActor with given id and data.
|
||||
"""
|
||||
media_actor = db.get(MediaActor, actor_id)
|
||||
if not media_actor:
|
||||
raise HTTPException(status_code=404, detail="MediaActor could not be found")
|
||||
actor_to_model(info, media_actor)
|
||||
db.add(media_actor)
|
||||
db.commit()
|
||||
mediaactor = db.get(MediaActor, actor_id)
|
||||
if not mediaactor:
|
||||
raise HTTPException(status_code=404, detail="MediaActor could not be found")
|
||||
response = actor_to_response(mediaactor)
|
||||
return response
|
||||
|
||||
@router.delete("/actors/{actor_id}", status_code=status.HTTP_204_NO_CONTENT)
|
||||
def delete_actor(actor_id: str, db: SessionDep):
|
||||
media_actor = db.get(MediaActor, actor_id)
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
|
||||
from typing import List
|
||||
|
||||
from fastapi import APIRouter, status, HTTPException
|
||||
|
||||
from src.db.models.media import MediaLofi
|
||||
from src.db.session import SessionDep
|
||||
from src.core.log_conf import logger
|
||||
from src.schema.media.lofi import (
|
||||
MediaLofiModel,
|
||||
MediaLofiResponse,
|
||||
lofi_to_response,
|
||||
lofi_to_model
|
||||
)
|
||||
from src.db.repository.media.lofi import (
|
||||
import_medialofi,
|
||||
delete_medialofi
|
||||
)
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.get("/lofi", response_model=List[MediaLofiResponse])
|
||||
def get_all_lofis(
|
||||
db: SessionDep, review: bool = False, download: bool = False
|
||||
) -> List[MediaLofiResponse]:
|
||||
"""
|
||||
Get all MediaLofis.
|
||||
"""
|
||||
results: List[MediaLofiResponse] = []
|
||||
lofis: List[MediaLofi]
|
||||
if review:
|
||||
lofis = db.query(MediaLofi).filter(MediaLofi.review.is_(True)).all()
|
||||
elif download:
|
||||
lofis = db.query(MediaLofi).filter(MediaLofi.should_download.is_(True)).all()
|
||||
else:
|
||||
lofis = db.query(MediaLofi).all()
|
||||
for medialofi in lofis:
|
||||
response = lofi_to_response(medialofi)
|
||||
results.append(response)
|
||||
return results
|
||||
|
||||
@router.get("/lofi/{lofi_id}", response_model=MediaLofiResponse)
|
||||
def get_lofi(lofi_id: str, db: SessionDep) -> MediaLofiResponse:
|
||||
"""
|
||||
Get MediaLofi by id.
|
||||
"""
|
||||
lofi = db.get(MediaLofi, lofi_id)
|
||||
if lofi is None:
|
||||
raise HTTPException(status_code=404, detail="MediaLofi could not be found")
|
||||
response = lofi_to_response(lofi)
|
||||
return response
|
||||
|
||||
@router.delete("/lofi/{lofi_id}", status_code=status.HTTP_204_NO_CONTENT)
|
||||
def delete_lofi(lofi_id: str, db: SessionDep):
|
||||
"""
|
||||
Delete MediaFile by given id.
|
||||
"""
|
||||
lofi = db.get(MediaLofi, lofi_id)
|
||||
if not lofi:
|
||||
raise HTTPException(status_code=404, detail="MediaLofi could not be found")
|
||||
logger.info("delete MediaLofi: %s", lofi_id)
|
||||
delete_medialofi(db=db, lofi_id=lofi.id)
|
||||
|
||||
@router.put("/lofi/{lofi_id}", response_model=MediaLofiResponse)
|
||||
def update_lofi(lofi_id: str, db: SessionDep, info: MediaLofiResponse) -> MediaLofiResponse:
|
||||
"""
|
||||
Update MediaLofi with given id and data.
|
||||
"""
|
||||
media_lofi = db.get(MediaLofi, lofi_id)
|
||||
if not media_lofi:
|
||||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="MediaLofi could not be found")
|
||||
lofi_to_model(info, media_lofi)
|
||||
db.add(media_lofi)
|
||||
db.commit()
|
||||
media_lofi = db.get(MediaLofi, lofi_id)
|
||||
if not media_lofi:
|
||||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="MediaLofi could not be found")
|
||||
response = lofi_to_response(media_lofi)
|
||||
return response
|
||||
|
||||
|
||||
@router.post("/lofi", status_code=status.HTTP_201_CREATED)
|
||||
def add_lofi(new_lofi: MediaLofiModel, db: SessionDep) -> MediaLofiResponse:
|
||||
logger.info("add medialofi %s", new_lofi)
|
||||
try:
|
||||
medialofi: MediaLofi = import_medialofi(db, new_lofi)
|
||||
except:
|
||||
raise HTTPException(status_code=409, detail="MediaLofi duplicate")
|
||||
response = lofi_to_response(medialofi)
|
||||
return response
|
||||
@@ -1,10 +1,9 @@
|
||||
from typing import List
|
||||
from fastapi import APIRouter, status, HTTPException
|
||||
from src.core.log_conf import logger
|
||||
from src.db.models.media import MediaActorFile
|
||||
from src.db.repository.media.actorfile import delete_mediaactorfile, import_mediaactorfile
|
||||
from src.db.repository.media.actorfile import delete_mediaactorfile
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.media.actorfile import MediaActorFileModel, MediaActorFileResponse, actorfile_to_response
|
||||
from src.schema.media.actorfile import MediaActorFileResponse, actorfile_to_response
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -31,13 +30,3 @@ def delete_actorfile(actorfile_id: str, db: SessionDep):
|
||||
if not media_actorfile:
|
||||
raise HTTPException(status_code=404, detail="MediaActor could not be found")
|
||||
delete_mediaactorfile(db, media_actorfile.id)
|
||||
|
||||
@router.post("/actorfiles", status_code=status.HTTP_201_CREATED)
|
||||
def add_actorfile(new_actorfile: MediaActorFileModel, db: SessionDep) -> MediaActorFileResponse:
|
||||
logger.info("add actorfile %s - %s", new_actorfile.media_actor_id, new_actorfile.media_file_id)
|
||||
try:
|
||||
mediaActorFile: MediaActorFile = import_mediaactorfile(db, new_actorfile)
|
||||
except Exception as exception:
|
||||
raise HTTPException(status_code=409, detail=f"Link duplicate: {exception}")
|
||||
response = actorfile_to_response(mediaActorFile)
|
||||
return response
|
||||
|
||||
@@ -9,21 +9,17 @@ load_dotenv(dotenv_path=env_path)
|
||||
|
||||
class Settings:
|
||||
PROJECT_NAME: str = "Kontor"
|
||||
PROJECT_VERSION: str = "0.4.0"
|
||||
PROJECT_VERSION: str = "0.3.0"
|
||||
|
||||
DB_USER: str = os.getenv("DB_USER", "kontor")
|
||||
DB_PASSWORD: str = os.getenv("DB_PASSWORD", "kontor")
|
||||
DB_SERVER: str = os.getenv("DB_SERVER", "postgres")
|
||||
DB_PORT: int = int(os.getenv("DB_PORT", 5432))
|
||||
DB_DBNAME: str = os.getenv("DB_DBNAME", "kontor")
|
||||
DATABASE_URL: str = (
|
||||
f"postgresql://{DB_USER}:{DB_PASSWORD}@{DB_SERVER}:{DB_PORT}/{DB_DBNAME}"
|
||||
)
|
||||
SECRET_KEY: str = os.getenv(
|
||||
"SECRET_KEY", "J6GOtcwC2NJI1l0VkHu20PacPFGTxpirBxWwynoHjsc="
|
||||
)
|
||||
DATABASE_URL: str = f"postgresql://{DB_USER}:{DB_PASSWORD}@{DB_SERVER}:{DB_PORT}/{DB_DBNAME}"
|
||||
SECRET_KEY: str = os.getenv("SECRET_KEY", "J6GOtcwC2NJI1l0VkHu20PacPFGTxpirBxWwynoHjsc=")
|
||||
ALGORITHM = "HS256"
|
||||
ACCESS_TOKEN_EXPIRE_MINUTES = 60 * 24 * 7 # one week in mins
|
||||
|
||||
ACCESS_TOKEN_EXPIRE_MINUTES = 60*24*7 # one week in mins
|
||||
|
||||
settings = Settings()
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ async def get_current_user(
|
||||
async def get_current_active_user(
|
||||
current_user: Annotated[Profile, Security(get_current_user, scopes=["me"])],
|
||||
) -> ProfileModel:
|
||||
if not bool(current_user.enabled):
|
||||
if not current_user.enabled:
|
||||
raise HTTPException(status_code=400, detail="Inactive user")
|
||||
user_model = to_model(current_user)
|
||||
return user_model
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
from typing import Any, Dict
|
||||
from src.db.models.admin import (
|
||||
Assignment,
|
||||
Token,
|
||||
Profile,
|
||||
Permission,
|
||||
MailAccount,
|
||||
Mail,
|
||||
)
|
||||
from src.db.models.bookshelf import (
|
||||
ArticleAuthor,
|
||||
BookAuthor,
|
||||
BookshelfPublisher,
|
||||
Article,
|
||||
Book,
|
||||
Author,
|
||||
)
|
||||
from src.db.models.comic import (
|
||||
Issue,
|
||||
StoryArc,
|
||||
TradePaperback,
|
||||
Volume,
|
||||
ComicWork,
|
||||
IssueWork,
|
||||
Artist,
|
||||
Comic,
|
||||
Publisher,
|
||||
WorkType,
|
||||
)
|
||||
from src.db.models.media import (
|
||||
MediaFile,
|
||||
MediaActor,
|
||||
MediaActorFile,
|
||||
MediaArticle,
|
||||
MediaVideo,
|
||||
MediaLofi,
|
||||
)
|
||||
from src.db.models.tysc import (
|
||||
Card,
|
||||
CardSet,
|
||||
Rooster,
|
||||
Team,
|
||||
FieldPosition,
|
||||
Player,
|
||||
Vendor,
|
||||
Sport,
|
||||
)
|
||||
|
||||
registry: Dict[str, Any] = {
|
||||
Sport.__tablename__: Sport,
|
||||
Player.__tablename__: Player,
|
||||
Team.__tablename__: Team,
|
||||
FieldPosition.__tablename__: FieldPosition,
|
||||
Rooster.__tablename__: Rooster,
|
||||
Vendor.__tablename__: Vendor,
|
||||
CardSet.__tablename__: CardSet,
|
||||
Card.__tablename__: Card,
|
||||
Artist.__tablename__: Artist,
|
||||
Publisher.__tablename__: Publisher,
|
||||
WorkType.__tablename__: WorkType,
|
||||
Comic.__tablename__: Comic,
|
||||
Volume.__tablename__: Volume,
|
||||
StoryArc.__tablename__: StoryArc,
|
||||
Issue.__tablename__: Issue,
|
||||
TradePaperback.__tablename__: TradePaperback,
|
||||
ComicWork.__tablename__: ComicWork,
|
||||
IssueWork.__tablename__: IssueWork,
|
||||
Article.__tablename__: Article,
|
||||
BookshelfPublisher.__tablename__: BookshelfPublisher,
|
||||
Book.__tablename__: Book,
|
||||
Author.__tablename__: Author,
|
||||
ArticleAuthor.__tablename__: ArticleAuthor,
|
||||
BookAuthor.__tablename__: BookAuthor,
|
||||
MediaArticle.__tablename__: MediaArticle,
|
||||
MediaVideo.__tablename__: MediaVideo,
|
||||
MediaLofi.__tablename__: MediaLofi,
|
||||
MediaFile.__tablename__: MediaFile,
|
||||
MediaActor.__tablename__: MediaActor,
|
||||
MediaActorFile.__tablename__: MediaActorFile,
|
||||
Profile.__tablename__: Profile,
|
||||
Permission.__tablename__: Permission,
|
||||
Assignment.__tablename__: Assignment,
|
||||
Token.__tablename__: Token,
|
||||
MailAccount.__tablename__: MailAccount,
|
||||
Mail.__tablename__: Mail
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict
|
||||
from typing import List
|
||||
|
||||
from sqlalchemy import Column, ForeignKey, Integer, String, Boolean
|
||||
from sqlalchemy import ForeignKey
|
||||
from sqlalchemy.orm import relationship, mapped_column, Mapped
|
||||
|
||||
from src.db.models.base import Base, BaseMixin
|
||||
@@ -9,14 +9,14 @@ from src.db.models.base import Base, BaseMixin
|
||||
|
||||
class Profile(Base, BaseMixin):
|
||||
__tablename__ = 'profile'
|
||||
first_name = Column(String)
|
||||
last_name = Column(String)
|
||||
user_name = Column(String, nullable=False)
|
||||
email = Column(String)
|
||||
password = Column(String)
|
||||
enabled = Column(Boolean)
|
||||
assignments = relationship("Assignment")
|
||||
tokens = relationship("Token")
|
||||
first_name: Mapped[str]
|
||||
last_name: Mapped[str]
|
||||
user_name: Mapped[str] = mapped_column(nullable=False)
|
||||
email: Mapped[str]
|
||||
password: Mapped[str]
|
||||
enabled: Mapped[bool]
|
||||
assignments: Mapped[List["Assignment"]] = relationship(back_populates="profile")
|
||||
tokens: Mapped[List["Token"]] = relationship(back_populates="profile")
|
||||
|
||||
def get_full_name(self) -> str:
|
||||
full_name: str = ""
|
||||
@@ -28,178 +28,48 @@ class Profile(Base, BaseMixin):
|
||||
full_name += str(self.last_name)
|
||||
return full_name
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.first_name = import_data['first_name']
|
||||
self.last_name = import_data['last_name']
|
||||
self.user_name = import_data['user_name']
|
||||
self.email = import_data['email']
|
||||
self.password = import_data['password']
|
||||
self.enabled = import_data['enabled']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['first_name'] = self.first_name
|
||||
item['last_name'] = self.last_name
|
||||
item['user_name'] = self.user_name
|
||||
item['email'] = self.email
|
||||
item['password'] = self.password
|
||||
item['enabled'] = self.enabled
|
||||
return item
|
||||
def __str__(self):
|
||||
return f"Profile({self.id} {self.user_name}, {self.email})"
|
||||
|
||||
|
||||
class Token(Base, BaseMixin):
|
||||
__tablename__ = "token"
|
||||
token = Column(String, nullable=False, unique=True)
|
||||
name = Column(String)
|
||||
last_used_date: Mapped[datetime] = mapped_column()
|
||||
enabled = Column(Boolean)
|
||||
profile_id = Column(String, ForeignKey("profile.id"), nullable=False)
|
||||
profile = relationship("Profile", back_populates="tokens")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.token = import_data['token']
|
||||
self.name = import_data['name']
|
||||
self.last_used_date = import_data['last_used_date']
|
||||
self.enabled = import_data['enabled']
|
||||
self.profile_id = import_data['profile_id']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['token'] = self.token
|
||||
item['name'] = self.name
|
||||
item['last_used_date'] = self.last_used_date
|
||||
item['enabled'] = self.enabled
|
||||
item['profile_id'] = self.profile_id
|
||||
return item
|
||||
token: Mapped[str] = mapped_column(nullable=False, unique=True)
|
||||
name: Mapped[str]
|
||||
last_used_date: Mapped[datetime]
|
||||
enabled: Mapped[bool]
|
||||
profile_id = mapped_column(ForeignKey("profile.id"), nullable=False)
|
||||
profile: Mapped[Profile] = relationship(back_populates="tokens")
|
||||
|
||||
|
||||
class Permission(Base, BaseMixin):
|
||||
__tablename__ = "permission"
|
||||
name = Column(String, nullable=False)
|
||||
assignments = relationship("Assignment")
|
||||
name: Mapped[str] = mapped_column(nullable=False)
|
||||
assignments: Mapped[List["Assignment"]] = relationship(back_populates="permission")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.name = import_data['name']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['name'] = self.name
|
||||
return item
|
||||
|
||||
class Assignment(Base, BaseMixin):
|
||||
__tablename__ = "assignment"
|
||||
profile_id = Column(String, ForeignKey("profile.id"), nullable=False)
|
||||
profile = relationship("Profile", back_populates="assignments")
|
||||
permission_id = Column(String, ForeignKey("permission.id"), nullable=False)
|
||||
permission = relationship("Permission", back_populates="assignments")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.profile_id = import_data['profile_id']
|
||||
self.permission_id = import_data['permission_id']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['profile_id'] = self.profile_id
|
||||
item['permission_id'] = self.permission_id
|
||||
return item
|
||||
profile_id = mapped_column(ForeignKey("profile.id"), nullable=False)
|
||||
profile: Mapped[Profile] = relationship(back_populates="assignments")
|
||||
permission_id = mapped_column(ForeignKey("permission.id"), nullable=False)
|
||||
permission: Mapped[Permission] = relationship(back_populates="assignments")
|
||||
|
||||
|
||||
class MailAccount(Base, BaseMixin):
|
||||
__tablename__ = "mail_account"
|
||||
host = Column(String)
|
||||
port = Column(Integer)
|
||||
protocol = Column(String)
|
||||
user_name = Column(String)
|
||||
password = Column(String)
|
||||
start_tls = Column(Boolean)
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.host = import_data['host']
|
||||
self.port = import_data['port']
|
||||
self.protocol = import_data['protocol']
|
||||
self.user_name = import_data['user_name']
|
||||
self.password = import_data['password']
|
||||
self.start_tls = import_data['start_tls']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['host'] = self.host
|
||||
item['port'] = self.port
|
||||
item['protocol'] = self.protocol
|
||||
item['user_name'] = self.user_name
|
||||
item['password'] = self.password
|
||||
item['start_tls'] = self.start_tls
|
||||
return item
|
||||
host: Mapped[str]
|
||||
port: Mapped[int]
|
||||
protocol: Mapped[str]
|
||||
user_name: Mapped[str]
|
||||
password: Mapped[str]
|
||||
start_tls: Mapped[bool]
|
||||
|
||||
|
||||
class Mail(Base, BaseMixin):
|
||||
__tablename__ = "mail"
|
||||
folder: Mapped[str] = mapped_column()
|
||||
subject: Mapped[str] = mapped_column()
|
||||
body: Mapped[str] = mapped_column()
|
||||
sent_date: Mapped[datetime] = mapped_column()
|
||||
received_date: Mapped[datetime] = mapped_column()
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.folder = import_data['folder']
|
||||
self.subject = import_data['subject']
|
||||
self.body = import_data['body']
|
||||
self.sent_date = import_data['sent_date']
|
||||
self.received_date = import_data['received_date']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['folder'] = self.folder
|
||||
item['subject'] = self.subject
|
||||
item['body'] = self.body
|
||||
item['sent_date'] = str(self.sent_date)
|
||||
item['received_date'] = str(self.received_date)
|
||||
return item
|
||||
folder: Mapped[str]
|
||||
subject: Mapped[str]
|
||||
body: Mapped[str]
|
||||
sent_date: Mapped[datetime]
|
||||
received_date: Mapped[datetime]
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
from typing import Optional
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import func, Column, String, Boolean
|
||||
from sqlalchemy import func
|
||||
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
|
||||
|
||||
|
||||
@@ -10,21 +11,17 @@ class Base(DeclarativeBase):
|
||||
|
||||
|
||||
class BaseMixin:
|
||||
#id = Column(String, primary_key=True, default=uuid.uuid4)
|
||||
id: Mapped[str] = mapped_column(primary_key=True, default=uuid.uuid4)
|
||||
# created_date = Column(DateTime)
|
||||
id: Mapped[str] = mapped_column(primary_key=True, default=str(uuid.uuid4()))
|
||||
created_date: Mapped[datetime] = mapped_column(default=func.now())
|
||||
# last_modified_date = Column(DateTime)
|
||||
last_modified_date: Mapped[datetime] = mapped_column(default=func.now())
|
||||
# version = Column(Integer)
|
||||
version: Mapped[int] = mapped_column(default=0)
|
||||
|
||||
|
||||
class BaseVideoMixin:
|
||||
cloud_link = Column(String, nullable=True)
|
||||
file_name = Column(String, nullable=True)
|
||||
path = Column(String)
|
||||
review = Column(Boolean)
|
||||
title = Column(String)
|
||||
url = Column(String, nullable=True)
|
||||
should_download = Column(Boolean)
|
||||
cloud_link: Mapped[Optional[str]]
|
||||
file_name: Mapped[Optional[str]]
|
||||
path: Mapped[str]
|
||||
review: Mapped[bool]
|
||||
title: Mapped[str]
|
||||
url: Mapped[str]
|
||||
should_download: Mapped[bool]
|
||||
|
||||
@@ -1,159 +1,52 @@
|
||||
from typing import Any, Dict
|
||||
from typing import List
|
||||
|
||||
from sqlalchemy import Column, ForeignKey, Integer, String
|
||||
from sqlalchemy.orm import relationship
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from src.db.models.base import Base, BaseMixin
|
||||
|
||||
|
||||
class Article(Base, BaseMixin):
|
||||
__tablename__ = 'article'
|
||||
title = Column(String, unique=True)
|
||||
title: Mapped[str] = mapped_column(unique=True)
|
||||
article_authors = relationship("ArticleAuthor")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.title = import_data['title']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['title'] = self.title
|
||||
return item
|
||||
|
||||
|
||||
class Author(Base, BaseMixin):
|
||||
__tablename__ = 'author'
|
||||
first_name = Column(String)
|
||||
last_name = Column(String)
|
||||
article_authors = relationship("ArticleAuthor")
|
||||
book_authors = relationship("BookAuthor")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.first_name = import_data['first_name']
|
||||
self.last_name = import_data['last_name']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['first_name'] = self.first_name
|
||||
item['last_name'] = self.last_name
|
||||
return item
|
||||
first_name: Mapped[str]
|
||||
last_name: Mapped[str]
|
||||
article_authors: Mapped[List["ArticleAuthor"]] = relationship(back_populates="author")
|
||||
book_authors: Mapped[List["BookAuthor"]] = relationship(back_populates="author")
|
||||
|
||||
|
||||
class BookshelfPublisher(Base, BaseMixin):
|
||||
__tablename__ = 'bookshelf_publisher'
|
||||
name = Column(String, unique=True)
|
||||
books = relationship("Book", back_populates="publisher")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.name = import_data['name']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['name'] = self.name
|
||||
return item
|
||||
name: Mapped[str] = mapped_column(unique=True)
|
||||
books: Mapped[List["Book"]] = relationship(back_populates="publisher")
|
||||
|
||||
|
||||
class Book(Base, BaseMixin):
|
||||
__tablename__ = 'book'
|
||||
isbn = Column(String, unique=True)
|
||||
title = Column(String)
|
||||
year = Column(Integer, nullable=False)
|
||||
publisher_id = Column(String, ForeignKey('bookshelf_publisher.id'), nullable=False)
|
||||
publisher = relationship('BookshelfPublisher', back_populates="books")
|
||||
book_authors = relationship("BookAuthor")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.isbn = import_data['isbn']
|
||||
self.title = import_data['title']
|
||||
self.year = import_data['year']
|
||||
self.publisher_id = import_data['publisher_id']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['isbn'] = self.isbn
|
||||
item['title'] = self.title
|
||||
item['year'] = self.year
|
||||
item['publisher_id'] = self.publisher_id
|
||||
return item
|
||||
isbn: Mapped[str] = mapped_column(unique=True)
|
||||
title: Mapped[str]
|
||||
year: Mapped[int] = mapped_column(nullable=False)
|
||||
publisher_id: Mapped[str] = mapped_column(ForeignKey("bookshelf_publisher.id"), nullable=False)
|
||||
publisher: Mapped[BookshelfPublisher] = relationship(back_populates="books")
|
||||
book_authors: Mapped[List["BookAuthor"]] = relationship(back_populates="book")
|
||||
|
||||
|
||||
class ArticleAuthor(Base, BaseMixin):
|
||||
__tablename__ = 'article_author'
|
||||
article_id = Column(String, ForeignKey('article.id'), nullable=False)
|
||||
article = relationship('Article', back_populates="article_authors")
|
||||
author_id = Column(String, ForeignKey('author.id'), nullable=False)
|
||||
author = relationship('Author', back_populates="article_authors")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.article_id = import_data['article_id']
|
||||
self.author_id = import_data['author_id']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['article_id'] = self.article_id
|
||||
item['author_id'] = self.author_id
|
||||
return item
|
||||
article_id: Mapped[str] = mapped_column(ForeignKey("article.id"), nullable=False)
|
||||
article: Mapped[Article] = relationship(back_populates="article_authors")
|
||||
author_id: Mapped[str] = mapped_column(ForeignKey("author.id"), nullable=False)
|
||||
author: Mapped[Author] = relationship(back_populates="article_authors")
|
||||
|
||||
|
||||
class BookAuthor(Base, BaseMixin):
|
||||
__tablename__ = 'book_author'
|
||||
author_id = Column(String, ForeignKey('author.id'), nullable=False)
|
||||
author = relationship('Author', back_populates="book_authors")
|
||||
book_id = Column(String, ForeignKey('book.id'), nullable=False)
|
||||
book = relationship('Book', back_populates="book_authors")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.author_id = import_data['author_id']
|
||||
self.book_id = import_data['book_id']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['author_id'] = self.author_id
|
||||
item['book_id'] = self.book_id
|
||||
return item
|
||||
author_id: Mapped[str] = mapped_column(ForeignKey("author.id"), nullable=False)
|
||||
author: Mapped[Author] = relationship(back_populates="book_authors")
|
||||
book_id: Mapped[str] = mapped_column(ForeignKey("book.id"), nullable=False)
|
||||
book: Mapped[Book] = relationship(back_populates="book_authors")
|
||||
|
||||
+114
-278
@@ -1,7 +1,8 @@
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from typing import Dict, List, Optional, Any
|
||||
from sqlalchemy import Column, ForeignKey, Integer, String, Boolean, func
|
||||
from natsort import natsorted
|
||||
from sqlalchemy import ForeignKey, func
|
||||
from sqlalchemy.orm import relationship, Mapped, mapped_column
|
||||
|
||||
from src.db.models.base import Base, BaseMixin
|
||||
@@ -13,12 +14,12 @@ class Publisher(Base):
|
||||
created_date: Mapped[datetime] = mapped_column(default=func.now())
|
||||
last_modified_date: Mapped[datetime] = mapped_column(default=func.now())
|
||||
version: Mapped[int] = mapped_column(default=0)
|
||||
name = Column(String, unique=True)
|
||||
weblink = Column(String, nullable=True)
|
||||
name: Mapped[str] = mapped_column(unique=True)
|
||||
weblink: Mapped[Optional[str]]
|
||||
parent_publisher_id: Mapped[Optional[str]] = mapped_column(ForeignKey('publisher.id'))
|
||||
parent_publisher: Mapped[Optional['Publisher']] = relationship("Publisher", back_populates="imprints", remote_side=[id])
|
||||
imprints: Mapped[List['Publisher']] = relationship('Publisher', back_populates="parent_publisher")
|
||||
comics = relationship("Comic")
|
||||
parent_publisher: Mapped[Optional['Publisher']] = relationship(back_populates="imprints", remote_side=[id])
|
||||
imprints: Mapped[List['Publisher']] = relationship(back_populates="parent_publisher")
|
||||
comics: Mapped[List["Comic"]] = relationship(back_populates="publisher")
|
||||
|
||||
def __repr__(self):
|
||||
return f'Publisher({self.id} {self.name})'
|
||||
@@ -26,40 +27,20 @@ class Publisher(Base):
|
||||
def __str__(self):
|
||||
return self.__repr__()
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.name = import_data['name']
|
||||
self.parent_publisher_id = import_data['parent_publisher_id']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {
|
||||
'id': self.id,
|
||||
'created_date': str(self.created_date),
|
||||
'last_modified_date': str(self.last_modified_date),
|
||||
'version': self.version,
|
||||
'name': self.name,
|
||||
'weblink': self.weblink,
|
||||
'parent_publisher_id': self.parent_publisher_id
|
||||
}
|
||||
return item
|
||||
|
||||
|
||||
class Comic(Base, BaseMixin):
|
||||
__tablename__ = 'comic'
|
||||
title = Column(String, unique=True)
|
||||
publisher_id = Column(String, ForeignKey('publisher.id'), nullable=False)
|
||||
publisher = relationship("Publisher", back_populates="comics")
|
||||
current_order = Column(Boolean)
|
||||
completed = Column(Boolean)
|
||||
weblink = Column(String, nullable=True)
|
||||
issues = relationship("Issue")
|
||||
story_arcs = relationship("StoryArc")
|
||||
trade_paperbacks = relationship("TradePaperback")
|
||||
volumes = relationship("Volume")
|
||||
comic_works = relationship("ComicWork")
|
||||
title: Mapped[str] = mapped_column(unique=True)
|
||||
publisher_id: Mapped[str] = mapped_column(ForeignKey('publisher.id'), nullable=False)
|
||||
publisher: Mapped[Publisher] = relationship(back_populates="comics")
|
||||
current_order: Mapped[bool]
|
||||
completed: Mapped[bool]
|
||||
weblink: Mapped[Optional[str]]
|
||||
issues: Mapped[List["Issue"]] = relationship(back_populates="comic", order_by="Issue.issue_number")
|
||||
story_arcs: Mapped[List["StoryArc"]] = relationship(back_populates="comic")
|
||||
trade_paperbacks: Mapped[List["TradePaperback"]] = relationship(back_populates="comic")
|
||||
volumes: Mapped[List["Volume"]] = relationship(back_populates="comic")
|
||||
comic_works: Mapped[List["ComicWork"]] = relationship(back_populates="comic")
|
||||
|
||||
def __repr__(self):
|
||||
return f'Comic({self.id} {self.version} {self.title} {self.publisher.name})'
|
||||
@@ -67,204 +48,118 @@ class Comic(Base, BaseMixin):
|
||||
def __str__(self):
|
||||
return f'{self.title}({self.id})'
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.title = import_data['title']
|
||||
self.publisher_id = import_data['publisher_id']
|
||||
self.current_order = import_data['current_order']
|
||||
self.completed = import_data['completed']
|
||||
if 'weblink' in import_data:
|
||||
self.weblink = import_data['weblink']
|
||||
def get_artists(self) -> Dict[Any, List[Any]]:
|
||||
works: Dict[Any, List[Any]] = {}
|
||||
for work in self.comic_works:
|
||||
work_type = work.work_type
|
||||
artist = work.artist
|
||||
if work_type in works:
|
||||
works[work_type].append(artist)
|
||||
else:
|
||||
works[work_type] = [artist]
|
||||
return works
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {
|
||||
'id': self.id,
|
||||
'created_date': str(self.created_date),
|
||||
'last_modified_date': str(self.last_modified_date),
|
||||
'version': self.version,
|
||||
'title': self.title,
|
||||
'publisher_id': self.publisher_id,
|
||||
'current_order': self.current_order,
|
||||
'completed': self.completed,
|
||||
'weblink': self.weblink
|
||||
}
|
||||
return item
|
||||
def sorted_issues(self):
|
||||
sorted_issues = natsorted(self.issues, key=lambda x: getattr(x, 'issue_number'))
|
||||
return sorted_issues
|
||||
|
||||
|
||||
class Volume(Base, BaseMixin):
|
||||
__tablename__ = "volume"
|
||||
name = Column(String, nullable=False)
|
||||
comic_id = Column(String, ForeignKey("comic.id"), nullable=False)
|
||||
comic = relationship("Comic", back_populates="volumes")
|
||||
story_arcs = relationship("StoryArc")
|
||||
issues = relationship("Issue")
|
||||
name: Mapped[str] = mapped_column(nullable=False)
|
||||
comic_id: Mapped[str] = mapped_column(ForeignKey("comic.id"), nullable=False)
|
||||
comic: Mapped[Comic] = relationship(back_populates="volumes")
|
||||
story_arcs: Mapped[List["StoryArc"]] = relationship(back_populates="volume")
|
||||
issues: Mapped[List["Issue"]] = relationship(back_populates="volume")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.name = import_data['name']
|
||||
self.comic_id = import_data['comic_id']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['name'] = self.name
|
||||
item['comic_id'] = self.comic_id
|
||||
return item
|
||||
|
||||
class TradePaperback(Base, BaseMixin):
|
||||
__tablename__ = "trade_paperback"
|
||||
name = Column(String, nullable=False)
|
||||
issue_start = Column(Integer)
|
||||
issue_end = Column(Integer)
|
||||
comic_id = Column(String, ForeignKey("comic.id"), nullable=False)
|
||||
comic = relationship("Comic", back_populates="trade_paperbacks")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.name = import_data['name']
|
||||
self.issue_start = import_data['issue_start']
|
||||
self.issue_end = import_data['issue_end']
|
||||
self.comic_id = import_data['comic_id']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['name'] = self.name
|
||||
item['issue_start'] = self.issue_start
|
||||
item['issue_end'] = self.issue_end
|
||||
item['comic_id'] = self.comic_id
|
||||
return item
|
||||
name: Mapped[str] = mapped_column(nullable=False)
|
||||
issue_start: Mapped[int]
|
||||
issue_end: Mapped[int]
|
||||
comic_id: Mapped[str] = mapped_column(ForeignKey("comic.id"), nullable=False)
|
||||
comic: Mapped[Comic] = relationship(back_populates="trade_paperbacks")
|
||||
|
||||
|
||||
class StoryArc(Base, BaseMixin):
|
||||
__tablename__ = "story_arc"
|
||||
name = Column(String, nullable=False)
|
||||
comic_id = Column(String, ForeignKey("comic.id"), nullable=False)
|
||||
comic = relationship("Comic", back_populates="story_arcs")
|
||||
volume_id = Column(String, ForeignKey("volume.id"), nullable=True)
|
||||
volume = relationship("Volume", back_populates="story_arcs")
|
||||
issues = relationship("Issue")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.name = import_data['name']
|
||||
self.comic_id = import_data['comic_id']
|
||||
self.volume_id = import_data['volume_id']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {
|
||||
'id': self.id,
|
||||
'created_date': str(self.created_date),
|
||||
'last_modified_date': str(self.last_modified_date),
|
||||
'version': self.version,
|
||||
'name': self.name,
|
||||
'comic_id': self.comic_id,
|
||||
'volume_id': self.volume_id
|
||||
}
|
||||
return item
|
||||
name: Mapped[str] = mapped_column(nullable=False)
|
||||
comic_id: Mapped[str] = mapped_column(ForeignKey("comic.id"), nullable=False)
|
||||
comic: Mapped[Comic] = relationship(back_populates="story_arcs")
|
||||
volume_id: Mapped[str] = mapped_column(ForeignKey("volume.id"), nullable=True)
|
||||
volume: Mapped[Volume] = relationship(back_populates="story_arcs")
|
||||
issues: Mapped[List["Issue"]] = relationship(back_populates="story_arc")
|
||||
|
||||
|
||||
class Issue(Base, BaseMixin):
|
||||
__tablename__ = "issue"
|
||||
issue_number = Column(String)
|
||||
title = Column(String, nullable=True)
|
||||
published_on: Mapped[datetime] = mapped_column(nullable=True)
|
||||
in_stock = Column(Boolean)
|
||||
is_read = Column(Boolean)
|
||||
comic_id = Column(String, ForeignKey("comic.id"), nullable=False)
|
||||
comic = relationship("Comic", back_populates="issues")
|
||||
volume_id = Column(String, ForeignKey("volume.id"), nullable=True)
|
||||
volume = relationship("Volume", back_populates="issues")
|
||||
story_arc_id = Column(String, ForeignKey("story_arc.id"), nullable=True)
|
||||
story_arc = relationship("StoryArc", back_populates="issues")
|
||||
issue_works = relationship("IssueWork")
|
||||
issue_number: Mapped[str]
|
||||
title: Mapped[Optional[str]]
|
||||
published_on: Mapped[Optional[datetime]]
|
||||
in_stock: Mapped[bool]
|
||||
is_read: Mapped[bool]
|
||||
comic_id: Mapped[str] = mapped_column(ForeignKey("comic.id"), nullable=False)
|
||||
comic: Mapped[Comic] = relationship(back_populates="issues")
|
||||
volume_id: Mapped[str] = mapped_column(ForeignKey("volume.id"), nullable=True)
|
||||
volume: Mapped[Volume] = relationship(back_populates="issues")
|
||||
story_arc_id: Mapped[str] = mapped_column(ForeignKey("story_arc.id"), nullable=True)
|
||||
story_arc: Mapped[StoryArc] = relationship(back_populates="issues")
|
||||
issue_works: Mapped[List["IssueWork"]] = relationship(back_populates="issue")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.issue_number = import_data['issue_number']
|
||||
self.title = import_data['title']
|
||||
if import_data['published_on'] == 'None':
|
||||
self.published_on = None # type: ignore
|
||||
else:
|
||||
self.published_on = import_data['published_on']
|
||||
self.in_stock = import_data['in_stock']
|
||||
self.is_read = import_data['is_read']
|
||||
self.comic_id = import_data['comic_id']
|
||||
self.volume_id = import_data['volume_id']
|
||||
self.story_arc_id = import_data['story_arc_id']
|
||||
def get_full_title(self) -> str:
|
||||
full_title: str = str(self.issue_number)
|
||||
if self.title:
|
||||
full_title += str(": " + self.title)
|
||||
return full_title
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {
|
||||
'id': self.id,
|
||||
'created_date': str(self.created_date),
|
||||
'last_modified_date': str(self.last_modified_date),
|
||||
'version': self.version,
|
||||
'issue_number': self.issue_number,
|
||||
'title': self.title,
|
||||
'published_on': str(self.published_on),
|
||||
'in_stock': self.in_stock,
|
||||
'is_read': self.is_read,
|
||||
'comic_id': self.comic_id,
|
||||
'volume_id': self.volume_id,
|
||||
'story_arc_id': self.story_arc_id
|
||||
}
|
||||
return item
|
||||
def get_artists(self) -> Dict[Any, List[Any]]:
|
||||
works: Dict[Any, List[Any]] = {}
|
||||
for work in self.issue_works:
|
||||
work_type = work.work_type
|
||||
artist = work.artist
|
||||
if work_type in works:
|
||||
works[work_type].append(artist)
|
||||
else:
|
||||
works[work_type] = [artist]
|
||||
return works
|
||||
|
||||
|
||||
class Artist(Base, BaseMixin):
|
||||
__tablename__ = "artist"
|
||||
name = Column(String, nullable=False)
|
||||
weblink = Column(String, nullable=True)
|
||||
comic_works = relationship("ComicWork")
|
||||
issue_works = relationship("IssueWork")
|
||||
name: Mapped[str] = mapped_column(nullable=False)
|
||||
weblink: Mapped[str] = mapped_column(nullable=True)
|
||||
comic_works: Mapped[List["ComicWork"]] = relationship(back_populates="artist")
|
||||
issue_works: Mapped[List["IssueWork"]] = relationship(back_populates="artist")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.name = import_data['name']
|
||||
if 'weblink' in import_data:
|
||||
self.weblink = import_data['weblink']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {
|
||||
'id': self.id,
|
||||
'created_date': str(self.created_date),
|
||||
'last_modified_date': str(self.last_modified_date),
|
||||
'version': self.version,
|
||||
'name': self.name,
|
||||
'weblink': self.weblink
|
||||
}
|
||||
return item
|
||||
def get_comics(self) -> Dict[Any, List[Comic]]:
|
||||
works: Dict[Any, List[Comic]] = {}
|
||||
for work in self.comic_works:
|
||||
work_type = work.work_type
|
||||
comic = work.comic
|
||||
if work_type in works:
|
||||
works[work_type].append(comic)
|
||||
else:
|
||||
works[work_type] = [comic]
|
||||
return works
|
||||
|
||||
|
||||
class WorkType(Base, BaseMixin):
|
||||
__tablename__ = "worktype"
|
||||
name = Column(String, nullable=False, unique=True)
|
||||
comic_works = relationship("ComicWork")
|
||||
issue_works = relationship("IssueWork")
|
||||
name: Mapped[str] = mapped_column(nullable=False, unique=True)
|
||||
comic_works: Mapped[List["ComicWork"]] = relationship(back_populates="work_type")
|
||||
issue_works: Mapped[List["IssueWork"]] = relationship(back_populates="work_type")
|
||||
|
||||
def get_artists(self) -> Dict[str, List[Artist]]:
|
||||
works: Dict[str, List[Artist]] = {}
|
||||
for work in self.comic_works:
|
||||
comic = work.comic.title
|
||||
artist = work.artist
|
||||
if comic in works:
|
||||
works[comic].append(artist)
|
||||
else:
|
||||
works[comic] = [artist]
|
||||
return works
|
||||
|
||||
def __repr__(self):
|
||||
return f'Worktype({self.id} {self.version} {self.name} {len(self.comic_works)})'
|
||||
@@ -272,81 +167,22 @@ class WorkType(Base, BaseMixin):
|
||||
def __str__(self):
|
||||
return f'{self.name}({self.id})'
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.name = import_data['name']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {
|
||||
'id': self.id,
|
||||
'created_date': str(self.created_date),
|
||||
'last_modified_date': str(self.last_modified_date),
|
||||
'version': self.version,
|
||||
'name': self.name
|
||||
}
|
||||
return item
|
||||
|
||||
|
||||
class ComicWork(Base, BaseMixin):
|
||||
__tablename__ = "comic_work"
|
||||
comic_id = Column(String, ForeignKey("comic.id"), nullable=False)
|
||||
comic = relationship("Comic", back_populates="comic_works")
|
||||
artist_id = Column(String, ForeignKey("artist.id"), nullable=False)
|
||||
artist = relationship("Artist", back_populates="comic_works")
|
||||
work_type_id = Column(String, ForeignKey("worktype.id"), nullable=False)
|
||||
work_type = relationship("WorkType", back_populates="comic_works")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.comic_id = import_data['comic_id']
|
||||
self.artist_id = import_data['artist_id']
|
||||
self.work_type_id = import_data['work_type_id']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {
|
||||
'id': self.id,
|
||||
'created_date': str(self.created_date),
|
||||
'last_modified_date': str(self.last_modified_date),
|
||||
'version': self.version,
|
||||
'comic_id': self.comic_id,
|
||||
'artist_id': self.artist_id,
|
||||
'work_type_id': self.work_type_id
|
||||
}
|
||||
return item
|
||||
comic_id: Mapped[str] = mapped_column(ForeignKey("comic.id"), nullable=False)
|
||||
comic: Mapped[Comic] = relationship(back_populates="comic_works")
|
||||
artist_id: Mapped[str] = mapped_column(ForeignKey("artist.id"), nullable=False)
|
||||
artist: Mapped[Artist] = relationship(back_populates="comic_works")
|
||||
work_type_id: Mapped[str] = mapped_column(ForeignKey("worktype.id"), nullable=False)
|
||||
work_type: Mapped[WorkType] = relationship(back_populates="comic_works")
|
||||
|
||||
|
||||
class IssueWork(Base, BaseMixin):
|
||||
__tablename__ = "issue_work"
|
||||
issue_id = Column(String, ForeignKey("issue.id"), nullable=False)
|
||||
issue = relationship("Issue", back_populates="issue_works")
|
||||
artist_id = Column(String, ForeignKey("artist.id"), nullable=False)
|
||||
artist = relationship("Artist", back_populates="issue_works")
|
||||
work_type_id = Column(String, ForeignKey("worktype.id"), nullable=False)
|
||||
work_type = relationship("WorkType", back_populates="issue_works")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.issue_id = import_data['issue_id']
|
||||
self.artist_id = import_data['artist_id']
|
||||
self.work_type_id = import_data['work_type_id']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {
|
||||
'id': self.id,
|
||||
'created_date': str(self.created_date),
|
||||
'last_modified_date': str(self.last_modified_date),
|
||||
'version': self.version,
|
||||
'issue_id': self.issue_id,
|
||||
'artist_id': self.artist_id,
|
||||
'work_type_id': self.work_type_id
|
||||
}
|
||||
return item
|
||||
issue_id: Mapped[str] = mapped_column(ForeignKey("issue.id"), nullable=False)
|
||||
issue: Mapped[Issue] = relationship(back_populates="issue_works")
|
||||
artist_id: Mapped[str] = mapped_column(ForeignKey("artist.id"), nullable=False)
|
||||
artist: Mapped[Artist] = relationship(back_populates="issue_works")
|
||||
work_type_id: Mapped[str] = mapped_column(ForeignKey("worktype.id"), nullable=False)
|
||||
work_type: Mapped[WorkType] = relationship(back_populates="issue_works")
|
||||
|
||||
@@ -1,207 +1,97 @@
|
||||
from typing import Any, Dict
|
||||
from sqlalchemy import Boolean, Column, String, ForeignKey
|
||||
from sqlalchemy.orm import relationship
|
||||
import logging
|
||||
import re
|
||||
import subprocess
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import List, Optional
|
||||
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
from sqlalchemy import ForeignKey
|
||||
from sqlalchemy.orm import Mapped, relationship, mapped_column
|
||||
|
||||
from src.db.models.base import Base, BaseMixin, BaseVideoMixin
|
||||
|
||||
|
||||
class MediaFile(Base, BaseMixin, BaseVideoMixin):
|
||||
__tablename__ = 'media_file'
|
||||
media_actor_files = relationship("MediaActorFile")
|
||||
"""
|
||||
MediaFile represents video link.
|
||||
"""
|
||||
|
||||
__tablename__ = "media_file"
|
||||
media_actor_files: Mapped[List["MediaActorFile"]] = relationship(
|
||||
back_populates="media_file"
|
||||
)
|
||||
|
||||
def __repr__(self):
|
||||
return f'MediaFile(\n\tID: {self.id}\n\tTitle: {self.title}\n\tURL: {self.url}\n\tReview: {self.review}\n\tDownload: {self.should_download}\n\tPath: {self.path}\n\tCloudlink: {self.cloud_link})'
|
||||
return f"MediaFile({self.id} {self.title} {self.title})"
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.title}({self.id})'
|
||||
return f"{self.title}({self.id})"
|
||||
|
||||
def update_title(self):
|
||||
pass
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.cloud_link = import_data['cloud_link']
|
||||
self.file_name = import_data['file_name']
|
||||
self.path = import_data['path']
|
||||
self.review = import_data['review']
|
||||
self.title = import_data['title']
|
||||
self.url = import_data['url']
|
||||
self.should_download = import_data['should_download']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['cloud_link'] = self.cloud_link
|
||||
item['file_name'] = self.file_name
|
||||
item['path'] = self.path
|
||||
item['review'] = self.review
|
||||
item['title'] = self.title
|
||||
item['url'] = self.url
|
||||
item['should_download'] = self.should_download
|
||||
return item
|
||||
"""
|
||||
Update title from url.
|
||||
"""
|
||||
|
||||
|
||||
class MediaActor(Base, BaseMixin):
|
||||
__tablename__ = 'media_actor'
|
||||
name = Column(String)
|
||||
url = Column(String, unique=True)
|
||||
__tablename__ = "media_actor"
|
||||
name: Mapped[str]
|
||||
url: Mapped[Optional[str]] = mapped_column(unique=True)
|
||||
media_actor_files = relationship("MediaActorFile")
|
||||
|
||||
def __repr__(self):
|
||||
return f'MediaActor(\n\tID: {self.id}\n\tName: {self.name}\n\tURL: {self.url})'
|
||||
def __repr__(self) -> str:
|
||||
return f"MediaActor({self.id} {self.name} {self.url})"
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.name}({self.id})'
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.name = import_data['name']
|
||||
self.url = import_data['url']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['name'] = self.name
|
||||
item['url'] = self.url
|
||||
return item
|
||||
def __str__(self) -> str:
|
||||
return f"{self.url}({self.id})"
|
||||
|
||||
|
||||
class MediaActorFile(Base, BaseMixin):
|
||||
__tablename__ = 'media_actor_file'
|
||||
media_actor_id = Column(String, ForeignKey("media_actor.id"), nullable=False)
|
||||
media_actor = relationship("MediaActor", back_populates="media_actor_files")
|
||||
media_file_id = Column(String, ForeignKey("media_file.id"), nullable=True)
|
||||
media_file = relationship("MediaFile", back_populates="media_actor_files")
|
||||
__tablename__ = "media_actor_file"
|
||||
media_actor_id: Mapped[str] = mapped_column(
|
||||
ForeignKey("media_actor.id"), nullable=False
|
||||
)
|
||||
media_actor: Mapped[MediaActor] = relationship(back_populates="media_actor_files")
|
||||
media_file_id: Mapped[str] = mapped_column(
|
||||
ForeignKey("media_file.id"), nullable=True
|
||||
)
|
||||
media_file: Mapped[MediaFile] = relationship(back_populates="media_actor_files")
|
||||
|
||||
def __repr__(self):
|
||||
return f'MediaActorFile(\n\tID: {self.id}\n\tMediaActor: {self.media_actor_id}\n\tMediaFile: {self.media_file_id})'
|
||||
return f"MediaActorFile({self.id} {self.media_actor_id} {self.media_file_id})"
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.id}: MediaActor: {self.media_actor_id} - MediaFile: {self.media_file_id}'
|
||||
def __str__(self) -> str:
|
||||
return f"{self.id} {self.media_actor_id} {self.media_file_id}"
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.media_actor_id = import_data['media_actor_id']
|
||||
self.media_file_id = import_data['media_file_id']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['media_actor_id'] = self.media_actor_id
|
||||
item['media_file_id'] = self.media_file_id
|
||||
return item
|
||||
|
||||
class MediaArticle(Base, BaseMixin):
|
||||
__tablename__ = 'media_article'
|
||||
review = Column(Boolean)
|
||||
title = Column(String)
|
||||
url = Column(String, unique=True)
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.review = import_data['review']
|
||||
self.title = import_data['title']
|
||||
self.url = import_data['url']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['review'] = self.review
|
||||
item['title'] = self.title
|
||||
item['url'] = self.url
|
||||
return item
|
||||
__tablename__ = "media_article"
|
||||
review: Mapped[bool]
|
||||
title: Mapped[str]
|
||||
url: Mapped[str] = mapped_column(unique=True)
|
||||
|
||||
|
||||
class MediaVideo(Base, BaseMixin):
|
||||
__tablename__ = 'media_video'
|
||||
cloud_link = Column(String)
|
||||
file_name = Column(String)
|
||||
path = Column(String)
|
||||
review = Column(Boolean)
|
||||
title = Column(String)
|
||||
url = Column(String, unique=True)
|
||||
should_download = Column(Boolean)
|
||||
"""
|
||||
MediaFile represents video link.
|
||||
"""
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.cloud_link = import_data['cloud_link']
|
||||
self.file_name = import_data['file_name']
|
||||
self.path = import_data['path']
|
||||
self.review = import_data['review']
|
||||
self.title = import_data['title']
|
||||
self.url = import_data['url']
|
||||
self.should_download = import_data['should_download']
|
||||
__tablename__ = "media_video"
|
||||
cloud_link: Mapped[str]
|
||||
file_name: Mapped[str]
|
||||
path: Mapped[str]
|
||||
review: Mapped[bool]
|
||||
title: Mapped[str]
|
||||
url: Mapped[str] = mapped_column(unique=True)
|
||||
should_download: Mapped[bool]
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['cloud_link'] = self.cloud_link
|
||||
item['file_name'] = self.file_name
|
||||
item['path'] = self.path
|
||||
item['review'] = self.review
|
||||
item['title'] = self.title
|
||||
item['url'] = self.url
|
||||
item['should_download'] = self.should_download
|
||||
return item
|
||||
def __repr__(self):
|
||||
return f"MediaFile({self.id} {self.title} {self.url})"
|
||||
|
||||
class MediaLofi(Base, BaseMixin):
|
||||
__tablename__ = 'media_lofi'
|
||||
file_name = Column(String)
|
||||
review = Column(Boolean)
|
||||
should_download = Column(Boolean)
|
||||
title = Column(String)
|
||||
url = Column(String, unique=True)
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.file_name = import_data['file_name']
|
||||
self.review = import_data['review']
|
||||
self.should_download = import_data['should_download']
|
||||
self.title = import_data['title']
|
||||
self.url = import_data['url']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['file_name'] = self.file_name
|
||||
item['review'] = self.review
|
||||
item['should_download'] = self.should_download
|
||||
item['title'] = self.title
|
||||
item['url'] = self.url
|
||||
return item
|
||||
def __str__(self):
|
||||
if self.title is None:
|
||||
return f"{self.url}({self.id})"
|
||||
else:
|
||||
return f"{self.title}({self.id})"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import Dict, Any
|
||||
from sqlalchemy import Column, Integer, String, ForeignKey, UniqueConstraint, Boolean
|
||||
from sqlalchemy.orm import relationship
|
||||
from typing import List
|
||||
from sqlalchemy import ForeignKey, UniqueConstraint
|
||||
from sqlalchemy.orm import relationship, mapped_column, Mapped
|
||||
|
||||
from src.db.models.base import Base, BaseMixin
|
||||
|
||||
@@ -10,56 +10,19 @@ class Sport(Base, BaseMixin):
|
||||
__table_args__ = (
|
||||
UniqueConstraint("name"),
|
||||
)
|
||||
name = Column(String, nullable=False, index=True, unique=True)
|
||||
teams = relationship("Team")
|
||||
positions = relationship("FieldPosition")
|
||||
name: Mapped[str] = mapped_column(nullable=False, index=True, unique=True)
|
||||
teams: Mapped[List["Team"]] = relationship(back_populates="sport")
|
||||
positions: Mapped[List["FieldPosition"]] = relationship(back_populates="sport")
|
||||
|
||||
def __repr__(self):
|
||||
return f"Sport(id={self.id}, name={self.name}, created_date={self.created_date})"
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.name = import_data['name']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['name'] = self.name
|
||||
return item
|
||||
|
||||
class Team(Base, BaseMixin):
|
||||
__tablename__ = "team"
|
||||
name = Column(String, nullable=False, index=True, unique=True)
|
||||
short_name = Column(String, nullable=False, )
|
||||
sport_id = Column(String, ForeignKey("sport.id"), nullable=False)
|
||||
sport = relationship("Sport", back_populates="teams")
|
||||
roosters = relationship("Rooster")
|
||||
name: Mapped[str] = mapped_column(nullable=False, index=True, unique=True)
|
||||
short_name: Mapped[str] = mapped_column(nullable=False)
|
||||
sport_id: Mapped[str] = mapped_column(ForeignKey("sport.id"), nullable=False)
|
||||
sport: Mapped[Sport] = relationship(back_populates="teams")
|
||||
roosters: Mapped[List["Rooster"]] = relationship(back_populates="team")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.name = import_data['name']
|
||||
self.short_name = import_data['short_name']
|
||||
self.sport_id = import_data['sport_id']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['name'] = self.name
|
||||
item['short_name'] = self.short_name
|
||||
item['sport_id'] = self.sport_id
|
||||
return item
|
||||
|
||||
class FieldPosition(Base, BaseMixin):
|
||||
__tablename__ = "field_position"
|
||||
@@ -67,31 +30,11 @@ class FieldPosition(Base, BaseMixin):
|
||||
UniqueConstraint("name", "sport_id"),
|
||||
UniqueConstraint("short_name", "sport_id"),
|
||||
)
|
||||
name = Column(String, nullable=False, index=True)
|
||||
short_name = Column(String, nullable=False)
|
||||
sport_id = Column(String, ForeignKey("sport.id"), nullable=False, index=True)
|
||||
sport = relationship("Sport", back_populates="positions")
|
||||
roosters = relationship("Rooster")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.name = import_data['name']
|
||||
self.short_name = import_data['short_name']
|
||||
self.sport_id = import_data['sport_id']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['name'] = self.name
|
||||
item['short_name'] = self.short_name
|
||||
item['sport_id'] = self.sport_id
|
||||
return item
|
||||
name: Mapped[str] = mapped_column(nullable=False, index=True)
|
||||
short_name: Mapped[str] = mapped_column(nullable=False)
|
||||
sport_id: Mapped[str] = mapped_column(ForeignKey("sport.id"), nullable=False, index=True)
|
||||
sport: Mapped[Sport] = relationship(back_populates="positions")
|
||||
roosters: Mapped[List["Rooster"]] = relationship(back_populates="position")
|
||||
|
||||
|
||||
class Player(Base, BaseMixin):
|
||||
@@ -99,90 +42,34 @@ class Player(Base, BaseMixin):
|
||||
__table_args__ = (
|
||||
UniqueConstraint("first_name", "last_name"),
|
||||
)
|
||||
first_name = Column(String, nullable=False, index=True)
|
||||
last_name = Column(String, nullable=False, index=True)
|
||||
roosters = relationship("Rooster")
|
||||
first_name: Mapped[str] = mapped_column(nullable=False, index=True)
|
||||
last_name: Mapped[str] = mapped_column(nullable=False, index=True)
|
||||
roosters: Mapped[List["Rooster"]] = relationship(back_populates="player")
|
||||
|
||||
def get_full_name(self) -> str:
|
||||
return f"{self.last_name}, {self.first_name}"
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.first_name = import_data['first_name']
|
||||
self.last_name = import_data['last_name']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['first_name'] = self.first_name
|
||||
item['last_name'] = self.last_name
|
||||
return item
|
||||
|
||||
|
||||
class Rooster(Base, BaseMixin):
|
||||
__tablename__ = "rooster"
|
||||
__table_args__ = (
|
||||
UniqueConstraint("year", "team_id", "player_id", "position_id"),
|
||||
)
|
||||
year = Column(Integer)
|
||||
team_id = Column(String, ForeignKey("team.id"), nullable=False, index=True)
|
||||
team = relationship("Team", back_populates="roosters")
|
||||
player_id = Column(String, ForeignKey("player.id"), nullable=False, index=True)
|
||||
player = relationship("Player", back_populates="roosters")
|
||||
position_id = Column(String, ForeignKey("field_position.id"), nullable=False, index=True)
|
||||
position = relationship("FieldPosition", back_populates="roosters")
|
||||
cards = relationship("Card")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.year = import_data['year']
|
||||
self.team_id = import_data['team_id']
|
||||
self.player_id = import_data['player_id']
|
||||
self.position_id = import_data['position_id']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['year'] = self.year
|
||||
item['team_id'] = self.team_id
|
||||
item['player_id'] = self.player_id
|
||||
item['position_id'] = self.position_id
|
||||
return item
|
||||
year: Mapped[int]
|
||||
team_id: Mapped[str] = mapped_column(ForeignKey("team.id"), nullable=False, index=True)
|
||||
team: Mapped[Team] = relationship(back_populates="roosters")
|
||||
player_id: Mapped[str] = mapped_column(ForeignKey("player.id"), nullable=False, index=True)
|
||||
player: Mapped[Player] = relationship(back_populates="roosters")
|
||||
position_id: Mapped[str] = mapped_column(ForeignKey("field_position.id"), nullable=False, index=True)
|
||||
position: Mapped[FieldPosition] = relationship(back_populates="roosters")
|
||||
cards: Mapped[List["Card"]] = relationship(back_populates="rooster")
|
||||
|
||||
|
||||
class Vendor(Base, BaseMixin):
|
||||
__tablename__ = "vendor"
|
||||
name = Column(String, nullable=False, unique=True, index=True)
|
||||
card_sets = relationship("CardSet")
|
||||
cards = relationship("Card")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.name = import_data['name']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['name'] = self.name
|
||||
return item
|
||||
name: Mapped[str] = mapped_column(nullable=False, unique=True, index=True)
|
||||
card_sets: Mapped[List["CardSet"]] = relationship(back_populates="vendor")
|
||||
cards: Mapped[List["Card"]] = relationship(back_populates="vendor")
|
||||
|
||||
|
||||
class CardSet(Base, BaseMixin):
|
||||
@@ -190,34 +77,12 @@ class CardSet(Base, BaseMixin):
|
||||
__table_args__ = (
|
||||
UniqueConstraint("name", "vendor_id"),
|
||||
)
|
||||
name = Column(String, index=True)
|
||||
parallel_set = Column(Boolean)
|
||||
insert_set = Column(Boolean)
|
||||
vendor_id = Column(String, ForeignKey("vendor.id"), nullable=False, index=True)
|
||||
vendor = relationship("Vendor", back_populates="card_sets")
|
||||
cards = relationship("Card")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.name = import_data['name']
|
||||
self.parallel_set = import_data['parallel_set']
|
||||
self.insert_set = import_data['insert_set']
|
||||
self.vendor_id = import_data['vendor_id']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['name'] = self.name
|
||||
item['parallel_set'] = self.parallel_set
|
||||
item['insert_set'] = self.insert_set
|
||||
item['vendor_id'] = self.vendor_id
|
||||
return item
|
||||
name: Mapped[str] = mapped_column(index=True)
|
||||
parallel_set: Mapped[bool]
|
||||
insert_set: Mapped[bool]
|
||||
vendor_id: Mapped[str] = mapped_column(ForeignKey("vendor.id"), nullable=False, index=True)
|
||||
vendor: Mapped[Vendor] = relationship(back_populates="card_sets")
|
||||
cards: Mapped[List["Card"]] = relationship(back_populates="card_set")
|
||||
|
||||
|
||||
class Card(Base, BaseMixin):
|
||||
@@ -225,35 +90,11 @@ class Card(Base, BaseMixin):
|
||||
__table_args__ = (
|
||||
UniqueConstraint("card_number", "year", "vendor_id", "card_set_id"),
|
||||
)
|
||||
card_number = Column(Integer, index=True)
|
||||
year = Column(Integer, index=True)
|
||||
card_set_id = Column(String, ForeignKey("card_set.id"), nullable=False)
|
||||
card_set = relationship("CardSet", back_populates="cards")
|
||||
rooster_id = Column(String, ForeignKey("rooster.id"), nullable=False)
|
||||
rooster = relationship("Rooster", back_populates="cards")
|
||||
vendor_id = Column(String, ForeignKey("vendor.id"), nullable=False)
|
||||
vendor = relationship("Vendor", back_populates="cards")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
self.created_date = import_data['created_date']
|
||||
self.last_modified_date = import_data['last_modified_date']
|
||||
self.version = import_data['version']
|
||||
self.card_number = import_data['card_number']
|
||||
self.year = import_data['year']
|
||||
self.card_set_id = import_data['card_set_id']
|
||||
self.rooster_id = import_data['rooster_id']
|
||||
self.vendor_id = import_data['vendor_id']
|
||||
|
||||
def export_dict(self) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {}
|
||||
item['id'] = self.id
|
||||
item['created_date'] = str(self.created_date)
|
||||
item['last_modified_date'] = str(self.last_modified_date)
|
||||
item['version'] = self.version
|
||||
item['card_number'] = self.card_number
|
||||
item['year'] = self.year
|
||||
item['card_set_id'] = self.card_set_id
|
||||
item['rooster_id'] = self.rooster_id
|
||||
item['vendor_id'] = self.vendor_id
|
||||
return item
|
||||
card_number: Mapped[int] = mapped_column(index=True)
|
||||
year: Mapped[int] = mapped_column(index=True)
|
||||
card_set_id: Mapped[str] = mapped_column(ForeignKey("card_set.id"), nullable=False)
|
||||
card_set: Mapped[CardSet] = relationship(back_populates="cards")
|
||||
rooster_id: Mapped[str] = mapped_column(ForeignKey("rooster.id"), nullable=False)
|
||||
rooster: Mapped[Rooster] = relationship(back_populates="cards")
|
||||
vendor_id: Mapped[str] = mapped_column(ForeignKey("vendor.id"), nullable=False)
|
||||
vendor: Mapped[Vendor] = relationship(back_populates="cards")
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import uuid
|
||||
from typing import List, Optional
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from src.core.log_conf import logger
|
||||
from src.db.models.comic import Artist
|
||||
from src.schema.comics.artist import AddArtist
|
||||
from src.schema.comics.artist_details import ArtistDetailResponse, ArtistWorktypeComicResponse, ArtistWorktypeIssueResponse
|
||||
@@ -15,17 +17,7 @@ def get_artist_details(artist: Artist) -> ArtistDetailResponse:
|
||||
for work in artist.comic_works:
|
||||
worktype_id = work.work_type.id
|
||||
if worktype_id in comic_works_map:
|
||||
comic = ComicResponse(
|
||||
id=work.comic.id,
|
||||
created_date=work.comic.created_date,
|
||||
last_modified_date=work.comic.last_modified_date,
|
||||
version=work.comic.version,
|
||||
publisher_id=work.comic.publisher_id,
|
||||
current_order=work.comic.current_order,
|
||||
weblink=work.comic.weblink,
|
||||
title=work.comic.title,
|
||||
completed=work.comic.completed
|
||||
)
|
||||
comic = ComicResponse(id=work.comic.id, title=work.comic.title, completed=work.comic.completed)
|
||||
comic_works_map[worktype_id].comics.append(comic)
|
||||
else:
|
||||
comic_works_map[worktype_id] = ArtistWorktypeComicResponse(
|
||||
@@ -45,6 +37,7 @@ def get_artist_details(artist: Artist) -> ArtistDetailResponse:
|
||||
return response
|
||||
|
||||
def update_artist(add_artist: AddArtist, artist_id: str, db: Session) -> Optional[Artist]:
|
||||
logger.info("update artist")
|
||||
artist: Optional[Artist] = db.get(Artist, artist_id)
|
||||
if artist is not None:
|
||||
artist.name = add_artist.name
|
||||
|
||||
@@ -2,6 +2,7 @@ from typing import Dict, List, Optional
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from src.core.log_conf import logger
|
||||
from src.db.models.comic import Comic, Issue
|
||||
from src.schema.comics.artist import artist_to_response
|
||||
from src.schema.comics.comic import ComicSchema, comic_to_response
|
||||
@@ -29,6 +30,7 @@ def get_issue_details(issue: Issue) -> IssueDetailsResponse:
|
||||
|
||||
|
||||
def update_comic(new_comic: ComicSchema, comic_id: str, db: Session) -> Optional[Comic]:
|
||||
logger.info(f"update_comic: {new_comic} with {comic_id}")
|
||||
comic: Optional[Comic] = db.get(Comic, comic_id)
|
||||
return comic
|
||||
|
||||
@@ -46,6 +48,7 @@ def get_comic_details(comic: Comic) -> ComicDetailsResponse:
|
||||
if worktype_id in works_map:
|
||||
artist = artist_to_response(work.artist)
|
||||
works_map[worktype_id].artists.append(artist)
|
||||
logger.info(f"add artist to response map: {artist} -> {works_map}")
|
||||
print(f"add artist to response map: {artist} -> {works_map}")
|
||||
else:
|
||||
works_map[worktype_id] = ComicWorktypeArtistResponse(
|
||||
|
||||
@@ -9,43 +9,15 @@ from src.schema.comics.publisher_details import PublisherDetailsResponse
|
||||
def get_publisher_details(publisher: Publisher) -> PublisherDetailsResponse:
|
||||
imprints: List[PublisherResponse] = []
|
||||
for imprint in publisher.imprints:
|
||||
imprints.append(
|
||||
PublisherResponse(
|
||||
id=imprint.id,
|
||||
created_date=imprint.created_date,
|
||||
last_modified_date=imprint.last_modified_date,
|
||||
version=imprint.version,
|
||||
weblink=str(imprint.weblink),
|
||||
parent_publisher_id=imprint.parent_publisher_id,
|
||||
name=str(imprint.name)
|
||||
)
|
||||
)
|
||||
imprints.append(PublisherResponse(id=imprint.id, name=str(imprint.name)))
|
||||
comics: List[ComicResponse] = []
|
||||
for comic in publisher.comics:
|
||||
comics.append(
|
||||
ComicResponse(
|
||||
id=comic.id,
|
||||
created_date=comic.created_date,
|
||||
last_modified_date=comic.last_modified_date,
|
||||
version=comic.version,
|
||||
publisher_id=comic.publisher_id,
|
||||
current_order=comic.current_order,
|
||||
weblink=comic.weblink,
|
||||
title=comic.title,
|
||||
completed=comic.completed
|
||||
)
|
||||
ComicResponse(id=comic.id, title=comic.title, completed=comic.completed)
|
||||
)
|
||||
parent_publisher: PublisherResponse | None = None
|
||||
if publisher.parent_publisher:
|
||||
parent_publisher = PublisherResponse(
|
||||
id=publisher.parent_publisher.id,
|
||||
created_date=publisher.parent_publisher.created_date,
|
||||
last_modified_date=publisher.parent_publisher.last_modified_date,
|
||||
version=publisher.parent_publisher.version,#
|
||||
weblink=str(publisher.parent_publisher.weblink),
|
||||
parent_publisher_id=publisher.parent_publisher.parent_publisher_id,
|
||||
name=str(publisher.parent_publisher.name)
|
||||
)
|
||||
parent_publisher = PublisherResponse(id=publisher.parent_publisher.id, name=str(publisher.parent_publisher.name))
|
||||
response: PublisherDetailsResponse = PublisherDetailsResponse(
|
||||
id=publisher.id, name=str(publisher.name), parent_publisher=parent_publisher, imprints=imprints, comics=comics
|
||||
)
|
||||
|
||||
@@ -4,6 +4,7 @@ from typing import AnyStr, Optional
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from src.core.log_conf import logger
|
||||
from src.db.models.comic import WorkType
|
||||
from src.schema.comics.worktype import AddWorkType
|
||||
|
||||
@@ -17,10 +18,12 @@ def create_new_worktype(work: AddWorkType, db: Session) -> WorkType:
|
||||
db.add(worktype)
|
||||
db.commit()
|
||||
db.refresh(worktype)
|
||||
logger.info(f"create_new_worktype: {worktype}")
|
||||
return worktype
|
||||
|
||||
|
||||
def update_worktype(work: AddWorkType, worktype_id: AnyStr, db: Session) -> Optional[WorkType]:
|
||||
logger.info("update worktype")
|
||||
worktype: Optional[WorkType] = db.get(WorkType, worktype_id)
|
||||
if worktype is not None:
|
||||
worktype.name = work.worktype
|
||||
|
||||
@@ -3,13 +3,14 @@ import uuid
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from src.core.log_conf import logger
|
||||
from src.db.models.media import MediaActor
|
||||
from src.db.repository.media.actorfile import delete_mediaactorfile
|
||||
from src.schema.media.actor import MediaActorModel
|
||||
|
||||
|
||||
def create_new_mediaactor(new_actor: MediaActorModel, db: Session) -> MediaActor:
|
||||
print(f"create MediaActor with url {new_actor.url}")
|
||||
logger.info(f"create MediaActor with url {new_actor.url}")
|
||||
media_actor: MediaActor = MediaActor()
|
||||
media_actor.id = str(uuid.uuid4())
|
||||
if new_actor.name is not None:
|
||||
@@ -21,11 +22,11 @@ def create_new_mediaactor(new_actor: MediaActorModel, db: Session) -> MediaActor
|
||||
db.add(media_actor)
|
||||
db.commit()
|
||||
db.refresh(media_actor)
|
||||
print(f"created {media_actor}")
|
||||
logger.info(f"created {media_actor}")
|
||||
return media_actor
|
||||
|
||||
def delete_mediaactor(db: Session, actor_id: str):
|
||||
print(f"delete MediaActor with id {actor_id}")
|
||||
logger.info(f"delete MediaActor with id {actor_id}")
|
||||
media_actor = db.get(MediaActor, actor_id)
|
||||
if media_actor is not None:
|
||||
actor_files = media_actor.media_actor_files
|
||||
@@ -39,7 +40,7 @@ def import_mediaactor(db: Session, new_actor: MediaActorModel) -> MediaActor:
|
||||
"""
|
||||
import MediaFile and set missing values with default ones.
|
||||
"""
|
||||
print("import MediaActor with %s", new_actor)
|
||||
logger.info("import MediaActor with %s", new_actor)
|
||||
media_actor: MediaActor = MediaActor()
|
||||
media_actor.id = new_actor.id
|
||||
if new_actor.created_date:
|
||||
|
||||
@@ -3,6 +3,7 @@ import uuid
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from src.core.log_conf import logger
|
||||
from src.db.models.media import MediaActorFile
|
||||
from src.schema.media.actorfile import MediaActorFileModel
|
||||
|
||||
@@ -13,7 +14,7 @@ def create_new_mediaactorfile(
|
||||
"""
|
||||
Create relation for MediaFile and MediaActor
|
||||
"""
|
||||
print("create MediaActorFile with actor %s and file %s", actor_id, file_id)
|
||||
logger.info("create MediaActorFile with actor %s and file %s", actor_id, file_id)
|
||||
media_actor_file: MediaActorFile = MediaActorFile()
|
||||
media_actor_file.id = str(uuid.uuid4())
|
||||
media_actor_file.created_date = datetime.now()
|
||||
@@ -31,7 +32,7 @@ def delete_mediaactorfile(db: Session, actorfile_id: str):
|
||||
"""
|
||||
Delete relation between MediaFile and MediaActor.
|
||||
"""
|
||||
print("delete MediaActorFile with id %s", actorfile_id)
|
||||
logger.info("delete MediaActorFile with id %s", actorfile_id)
|
||||
media_actorfile = db.get(MediaActorFile, actorfile_id)
|
||||
db.delete(media_actorfile)
|
||||
db.commit()
|
||||
@@ -43,21 +44,6 @@ def import_mediaactorfile(
|
||||
"""
|
||||
Import MediaFile and set missing values with default ones.
|
||||
"""
|
||||
print("import MediaActorFile with %s", new_actorfile)
|
||||
logger.info("import MediaActorFile with %s", new_actorfile)
|
||||
media_actor_file: MediaActorFile = MediaActorFile()
|
||||
media_actor_file.id = new_actorfile.id
|
||||
if new_actorfile.created_date:
|
||||
media_actor_file.created_date = new_actorfile.created_date
|
||||
else:
|
||||
media_actor_file.created_date = datetime.now()
|
||||
if new_actorfile.last_modified_date:
|
||||
media_actor_file.last_modified_date = new_actorfile.last_modified_date
|
||||
else:
|
||||
media_actor_file.last_modified_date = datetime.now()
|
||||
media_actor_file.version = new_actorfile.version
|
||||
media_actor_file.media_actor_id = new_actorfile.media_actor_id
|
||||
media_actor_file.media_file_id = new_actorfile.media_file_id
|
||||
db.add(media_actor_file)
|
||||
db.commit()
|
||||
db.refresh(media_actor_file)
|
||||
return media_actor_file
|
||||
|
||||
@@ -3,6 +3,7 @@ import uuid
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from src.core.log_conf import logger
|
||||
from src.db.models.media import MediaFile
|
||||
from src.schema.media.file import MediaFileModel
|
||||
|
||||
@@ -11,7 +12,7 @@ def create_new_mediafile(link: str, db: Session) -> MediaFile:
|
||||
"""
|
||||
Create MediaFile with gievne URL.
|
||||
"""
|
||||
print("create MediaFile with url {link}")
|
||||
logger.info("create MediaFile with url {link}")
|
||||
media_file: MediaFile = MediaFile()
|
||||
media_file.id = str(uuid.uuid4())
|
||||
media_file.url = link
|
||||
@@ -23,7 +24,7 @@ def create_new_mediafile(link: str, db: Session) -> MediaFile:
|
||||
db.add(media_file)
|
||||
db.commit()
|
||||
db.refresh(media_file)
|
||||
print("created %s", media_file)
|
||||
logger.info("created %s", media_file)
|
||||
return media_file
|
||||
|
||||
|
||||
@@ -31,7 +32,7 @@ def delete_mediafile(db: Session, media_file_id: str):
|
||||
"""
|
||||
Delete MediaFile with given ID from db.
|
||||
"""
|
||||
print("delete MediaFile with id %s", media_file_id)
|
||||
logger.info("delete MediaFile with id %s", media_file_id)
|
||||
media_file = db.get(MediaFile, media_file_id)
|
||||
db.delete(media_file)
|
||||
db.commit()
|
||||
@@ -41,7 +42,7 @@ def import_mediafile(db: Session, new_file: MediaFileModel) -> MediaFile:
|
||||
"""
|
||||
import MediaActor and set missing values with defautl ones.
|
||||
"""
|
||||
print("import MediaFile with %s", new_file)
|
||||
logger.info("import MediaFile with %s", new_file)
|
||||
media_file: MediaFile = MediaFile()
|
||||
media_file.id = new_file.id
|
||||
if new_file.created_date:
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
from datetime import datetime
|
||||
import uuid
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from src.db.models.media import MediaLofi
|
||||
from src.schema.media.lofi import MediaLofiModel
|
||||
|
||||
|
||||
def create_new_lofi(url: str, db: Session) -> MediaLofi:
|
||||
"""
|
||||
Create MediaLofi with given URL.
|
||||
"""
|
||||
print("create MediaLofi with url %s", url)
|
||||
media_lofi = MediaLofi()
|
||||
media_lofi.id = str(uuid.uuid4())
|
||||
media_lofi.url = url
|
||||
media_lofi.created_date = datetime.now()
|
||||
media_lofi.last_modified_date = datetime.now()
|
||||
media_lofi.review = True
|
||||
media_lofi.should_download = False
|
||||
db.add(media_lofi)
|
||||
db.commit()
|
||||
db.refresh(media_lofi)
|
||||
print(media_lofi)
|
||||
return media_lofi
|
||||
|
||||
def import_medialofi(db: Session, new_lofi: MediaLofiModel) -> MediaLofi:
|
||||
"""
|
||||
import MediaLofi and set missing values with default ones.
|
||||
"""
|
||||
print("import MediaLofi with %s", new_lofi)
|
||||
media_lofi: MediaLofi = MediaLofi()
|
||||
media_lofi.id = new_lofi.id
|
||||
if new_lofi.created_date:
|
||||
media_lofi.created_date = new_lofi.created_date
|
||||
else:
|
||||
media_lofi.created_date = datetime.now()
|
||||
if new_lofi.last_modified_date:
|
||||
media_lofi.last_modified_date = new_lofi.last_modified_date
|
||||
else:
|
||||
media_lofi.last_modified_date = datetime.now()
|
||||
media_lofi.version = new_lofi.version
|
||||
if new_lofi.title:
|
||||
media_lofi.title = new_lofi.title
|
||||
else:
|
||||
media_lofi.title = ""
|
||||
if new_lofi.url:
|
||||
media_lofi.url = new_lofi.url
|
||||
else:
|
||||
# TODO shoud exeception be raised when url is missing?
|
||||
media_lofi.url = ""
|
||||
media_lofi.review = new_lofi.review
|
||||
media_lofi.should_download = new_lofi.should_download
|
||||
db.add(media_lofi)
|
||||
db.commit()
|
||||
db.refresh(media_lofi)
|
||||
return media_lofi
|
||||
|
||||
|
||||
def delete_medialofi(db: Session, lofi_id: str):
|
||||
"""
|
||||
Delete MediaLofi with given ID from db.
|
||||
"""
|
||||
print("delete MediaLofi with id %s", lofi_id)
|
||||
lofi = db.get(MediaLofi, lofi_id)
|
||||
db.delete(lofi)
|
||||
db.commit()
|
||||
|
||||
@@ -4,13 +4,14 @@ import uuid
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from src.db.models.media import MediaVideo
|
||||
from src.webapps.media.forms import AddLinkForm
|
||||
|
||||
|
||||
def create_new_video(url: str, db: Session) -> MediaVideo:
|
||||
print(url)
|
||||
def create_new_video(video: AddLinkForm, db: Session) -> MediaVideo:
|
||||
print(video.url)
|
||||
media_video = MediaVideo()
|
||||
media_video.id = str(uuid.uuid4())
|
||||
media_video.url = url
|
||||
media_video.url = str(video.url)
|
||||
media_video.created_date = datetime.now()
|
||||
media_video.last_modified_date = datetime.now()
|
||||
media_video.review = True
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
import uuid
|
||||
from src.core.log_conf import logger
|
||||
from src.db.models.admin import Assignment, Profile
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
@@ -8,7 +9,7 @@ from src.schema.user.profile import ProfileModel
|
||||
|
||||
|
||||
def create_new_profile(new_profile: ProfileModel, db: Session) -> Profile:
|
||||
print(f"create Profile with username {new_profile.username}")
|
||||
logger.info(f"create MediaActor with url {new_profile.username}")
|
||||
profile: Profile = Profile()
|
||||
profile.id = str(uuid.uuid4())
|
||||
profile.user_name = new_profile.username
|
||||
@@ -20,11 +21,11 @@ def create_new_profile(new_profile: ProfileModel, db: Session) -> Profile:
|
||||
db.add(profile)
|
||||
db.commit()
|
||||
db.refresh(profile)
|
||||
print(f"created {profile}")
|
||||
logger.info(f"created {profile}")
|
||||
return profile
|
||||
|
||||
def delete_profile(db: Session, profile_id: str):
|
||||
print(f"delete Profile with id {profile_id}")
|
||||
logger.info(f"delete Profile with id {profile_id}")
|
||||
profile: Optional[Profile] = db.get(Profile, profile_id)
|
||||
if profile is not None:
|
||||
assignments = profile.assignments
|
||||
@@ -34,7 +35,7 @@ def delete_profile(db: Session, profile_id: str):
|
||||
db.commit()
|
||||
|
||||
def delete_assignment(db: Session, assignment_id: str) -> None:
|
||||
print(f"delete Assignment with id {assignment_id}")
|
||||
logger.info(f"delete Assignment with id {assignment_id}")
|
||||
assignment: Optional[Assignment] = db.get(Assignment, assignment_id)
|
||||
if assignment is not None:
|
||||
db.delete(assignment)
|
||||
|
||||
@@ -24,11 +24,11 @@ def to_response(account: MailAccount) -> MailAccountResponse:
|
||||
created_date=account.created_date,
|
||||
last_modified_date=account.last_modified_date,
|
||||
version=account.version,
|
||||
host=str(account.host),
|
||||
host=account.host,
|
||||
port=account.port,
|
||||
protocol=str(account.protocol),
|
||||
user_name=str(account.user_name),
|
||||
password=str(account.password),
|
||||
start_tls=bool(account.start_tls),
|
||||
protocol=account.protocol,
|
||||
user_name=account.user_name,
|
||||
password=account.password,
|
||||
start_tls=account.start_tls,
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -18,6 +18,6 @@ def to_response(article: Article) -> ArticleResponse:
|
||||
created_date=article.created_date,
|
||||
last_modified_date=article.last_modified_date,
|
||||
version=article.version,
|
||||
title=str(article.title)
|
||||
title=article.title
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -19,7 +19,7 @@ def to_response(articleauthor: ArticleAuthor) -> ArticleAuthorResponse:
|
||||
created_date=articleauthor.created_date,
|
||||
last_modified_date=articleauthor.last_modified_date,
|
||||
version=articleauthor.version,
|
||||
article_id=str(articleauthor.article_id),
|
||||
author_id=str(articleauthor.author_id)
|
||||
article_id=articleauthor.article_id,
|
||||
author_id=articleauthor.author_id
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -19,7 +19,7 @@ def to_response(author: Author) -> AuthorResponse:
|
||||
created_date=author.created_date,
|
||||
last_modified_date=author.last_modified_date,
|
||||
version=author.version,
|
||||
first_name=str(author.first_name),
|
||||
last_name=str(author.last_name)
|
||||
first_name=author.first_name,
|
||||
last_name=author.last_name
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -21,9 +21,9 @@ def to_response(book: Book) -> BookResponse:
|
||||
created_date=book.created_date,
|
||||
last_modified_date=book.last_modified_date,
|
||||
version=book.version,
|
||||
isbn=str(book.isbn),
|
||||
title=str(book.title),
|
||||
isbn=book.isbn,
|
||||
title=book.title,
|
||||
year=book.year,
|
||||
publisher_id=str(book.publisher_id)
|
||||
publisher_id=book.publisher_id
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -19,7 +19,7 @@ def to_response(bookauthor: BookAuthor) -> BookAuthorResponse:
|
||||
created_date=bookauthor.created_date,
|
||||
last_modified_date=bookauthor.last_modified_date,
|
||||
version=bookauthor.version,
|
||||
author_id=str(bookauthor.author_id),
|
||||
book_id=str(bookauthor.book_id)
|
||||
author_id=bookauthor.author_id,
|
||||
book_id=bookauthor.book_id
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -18,6 +18,6 @@ def to_response(publisher: BookshelfPublisher) -> PublisherResponse:
|
||||
created_date=publisher.created_date,
|
||||
last_modified_date=publisher.last_modified_date,
|
||||
version=publisher.version,
|
||||
name=str(publisher.name)
|
||||
name=publisher.name
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -28,11 +28,11 @@ def comic_to_response(comic: Comic) -> ComicResponse:
|
||||
created_date=comic.created_date,
|
||||
last_modified_date=comic.last_modified_date,
|
||||
version=comic.version,
|
||||
title=str(comic.title),
|
||||
publisher_id=str(comic.publisher_id),
|
||||
current_order=bool(comic.current_order),
|
||||
completed=bool(comic.completed),
|
||||
weblink=str(comic.weblink)
|
||||
title=comic.title,
|
||||
publisher_id=comic.publisher_id,
|
||||
current_order=comic.current_order,
|
||||
completed=comic.completed,
|
||||
weblink=comic.weblink
|
||||
)
|
||||
return response
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ def comicwork_to_response(comicwork: ComicWork) -> ComicWorkResponse:
|
||||
created_date=comicwork.created_date,
|
||||
last_modified_date=comicwork.last_modified_date,
|
||||
version=comicwork.version,
|
||||
comic_id=str(comicwork.comic_id),
|
||||
artist_id=str(comicwork.artist_id),
|
||||
work_type_id=str(comicwork.work_type_id),
|
||||
comic_id=comicwork.comic_id,
|
||||
artist_id=comicwork.artist_id,
|
||||
work_type_id=comicwork.work_type_id,
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -26,13 +26,13 @@ def issue_to_response(issue: Issue) -> IssueResponse:
|
||||
created_date=issue.created_date,
|
||||
last_modified_date=issue.last_modified_date,
|
||||
version=issue.version,
|
||||
issue_number=str(issue.issue_number),
|
||||
title=str(issue.title),
|
||||
issue_number=issue.issue_number,
|
||||
title=issue.title,
|
||||
published_on=issue.published_on,
|
||||
in_stock=bool(issue.in_stock),
|
||||
is_read=bool(issue.is_read),
|
||||
comic_id=str(issue.comic_id),
|
||||
volume_id=str(issue.volume_id),
|
||||
story_arc_id=str(issue.story_arc_id)
|
||||
in_stock=issue.in_stock,
|
||||
is_read=issue.is_read,
|
||||
comic_id=issue.comic_id,
|
||||
volume_id=issue.volume_id,
|
||||
story_arc_id=issue.story_arc_id
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -25,8 +25,8 @@ def issuework_to_response(issuework: IssueWork) -> IssueWorkResponse:
|
||||
created_date=issuework.created_date,
|
||||
last_modified_date=issuework.last_modified_date,
|
||||
version=issuework.version,
|
||||
issue_id=str(issuework.issue_id),
|
||||
artist_id=str(issuework.artist_id),
|
||||
work_type_id=str(issuework.work_type_id),
|
||||
issue_id=issuework.issue_id,
|
||||
artist_id=issuework.artist_id,
|
||||
work_type_id=issuework.work_type_id,
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -22,8 +22,8 @@ def publisher_to_response(publisher: Publisher) -> PublisherResponse:
|
||||
created_date=publisher.created_date,
|
||||
last_modified_date=publisher.last_modified_date,
|
||||
version=publisher.version,
|
||||
name=str(publisher.name),
|
||||
weblink=str(publisher.weblink),
|
||||
name=publisher.name,
|
||||
weblink=publisher.weblink,
|
||||
parent_publisher_id=publisher.parent_publisher_id
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -23,8 +23,8 @@ def storyarc_to_response(storyarc: StoryArc) -> StoryArcResponse:
|
||||
created_date=storyarc.created_date,
|
||||
last_modified_date=storyarc.last_modified_date,
|
||||
version=storyarc.version,
|
||||
name=str(storyarc.name),
|
||||
comic_id=str(storyarc.comic_id),
|
||||
volume_id=str(storyarc.volume_id)
|
||||
name=storyarc.name,
|
||||
comic_id=storyarc.comic_id,
|
||||
volume_id=storyarc.volume_id
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -19,7 +19,7 @@ def volume_to_response(volume: Volume) -> VolumeResponse:
|
||||
created_date=volume.created_date,
|
||||
last_modified_date=volume.last_modified_date,
|
||||
version=volume.version,
|
||||
name=str(volume.name),
|
||||
comic_id=str(volume.comic_id)
|
||||
name=volume.name,
|
||||
comic_id=volume.comic_id
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -21,6 +21,6 @@ def worktype_to_response(worktype: WorkType) -> WorktypeResponse:
|
||||
created_date=worktype.created_date,
|
||||
last_modified_date=worktype.last_modified_date,
|
||||
version=worktype.version,
|
||||
name=str(worktype.name)
|
||||
name=worktype.name
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -19,8 +19,8 @@ def actor_to_response(actor: MediaActor) -> MediaActorResponse:
|
||||
created_date=actor.created_date,
|
||||
last_modified_date=actor.last_modified_date,
|
||||
version=actor.version,
|
||||
name=str(actor.name),
|
||||
url=str(actor.url)
|
||||
name=actor.name,
|
||||
url=actor.url
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -32,27 +32,3 @@ class MediaActorModel(BaseModel):
|
||||
version: int
|
||||
name: Optional[str]
|
||||
url: Optional[str]
|
||||
|
||||
def actor_to_model(model: MediaActorResponse, media_actor: MediaActor) -> MediaActor:
|
||||
"""
|
||||
Set data of response to model
|
||||
"""
|
||||
media_actor.file_name = model.file_name
|
||||
if model.url is not None:
|
||||
media_actor.url = model.url
|
||||
else:
|
||||
media_actor.url = ""
|
||||
media_actor.last_modified_date = datetime.now()
|
||||
return media_actor
|
||||
|
||||
|
||||
def actor_to_response(media_actor: MediaActor) -> MediaActorResponse:
|
||||
response: MediaActorResponse = MediaActorResponse(
|
||||
id=media_actor.id,
|
||||
created_date=media_actor.created_date,
|
||||
last_modified_date=media_actor.last_modified_date,
|
||||
version=media_actor.version,
|
||||
name=str(media_actor.name),
|
||||
url=str(media_actor.url),
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -19,8 +19,8 @@ def actorfile_to_response(actorfile: MediaActorFile) -> MediaActorFileResponse:
|
||||
created_date=actorfile.created_date,
|
||||
last_modified_date=actorfile.last_modified_date,
|
||||
version=actorfile.version,
|
||||
media_actor_id=str(actorfile.media_actor_id),
|
||||
media_file_id=str(actorfile.media_file_id)
|
||||
media_actor_id=actorfile.media_actor_id,
|
||||
media_file_id=actorfile.media_file_id
|
||||
)
|
||||
return response
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ def to_response(video: MediaArticle) -> MediaArticleResponse:
|
||||
created_date=video.created_date,
|
||||
last_modified_date=video.last_modified_date,
|
||||
version=video.version,
|
||||
review=bool(video.review),
|
||||
title=str(video.title),
|
||||
url=str(video.url),
|
||||
review=video.review,
|
||||
title=video.title,
|
||||
url=video.url,
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from src.db.models.media import MediaLofi
|
||||
|
||||
class MediaLofiResponse(BaseModel):
|
||||
id: str
|
||||
created_date: datetime
|
||||
last_modified_date: datetime
|
||||
version: int
|
||||
title: str = ""
|
||||
file_name: str = ""
|
||||
url: str = ""
|
||||
review: bool = False
|
||||
should_download: bool = False
|
||||
|
||||
class AddLofi(BaseModel):
|
||||
url: str
|
||||
|
||||
class MediaLofiModel(BaseModel):
|
||||
"""
|
||||
Pydantic Model to import MediaLofi.
|
||||
"""
|
||||
id: str
|
||||
created_date: datetime
|
||||
last_modified_date: datetime
|
||||
version: int = 0
|
||||
title: str = ""
|
||||
file_name: str = ""
|
||||
url: str = ""
|
||||
review: bool = False
|
||||
should_download: bool = False
|
||||
|
||||
|
||||
def lofi_to_model(model: MediaLofiResponse, medialofi: MediaLofi) -> MediaLofi:
|
||||
"""
|
||||
Set data of response to model
|
||||
"""
|
||||
medialofi.file_name = model.file_name
|
||||
if model.url is not None:
|
||||
medialofi.url = model.url
|
||||
else:
|
||||
medialofi.url = ""
|
||||
if model.title is not None:
|
||||
medialofi.title = model.title
|
||||
else:
|
||||
medialofi.title = ""
|
||||
medialofi.last_modified_date = datetime.now()
|
||||
medialofi.review = model.review
|
||||
medialofi.should_download = model.should_download
|
||||
return medialofi
|
||||
|
||||
|
||||
def lofi_to_response(lofi: MediaLofi) -> MediaLofiResponse:
|
||||
response: MediaLofiResponse = MediaLofiResponse(
|
||||
id=lofi.id,
|
||||
created_date=lofi.created_date,
|
||||
last_modified_date=lofi.last_modified_date,
|
||||
version=lofi.version,
|
||||
file_name=str(lofi.file_name),
|
||||
review=bool(lofi.review),
|
||||
should_download=bool(lofi.should_download),
|
||||
title=str(lofi.title),
|
||||
url=str(lofi.url),
|
||||
)
|
||||
return response
|
||||
@@ -27,12 +27,12 @@ def video_to_response(video: MediaVideo) -> MediaVideoResponse:
|
||||
created_date=video.created_date,
|
||||
last_modified_date=video.last_modified_date,
|
||||
version=video.version,
|
||||
cloud_link=str(video.cloud_link),
|
||||
file_name=str(video.file_name),
|
||||
path=str(video.path),
|
||||
review=bool(video.review),
|
||||
title=str(video.title),
|
||||
url=str(video.url),
|
||||
should_download=bool(video.should_download)
|
||||
cloud_link=video.cloud_link,
|
||||
file_name=video.file_name,
|
||||
path=video.path,
|
||||
review=video.review,
|
||||
title=video.title,
|
||||
url=video.url,
|
||||
should_download=video.should_download
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -24,8 +24,8 @@ def to_response(card: Card) -> CardResponse:
|
||||
version=card.version,
|
||||
card_number=card.card_number,
|
||||
year=card.year,
|
||||
card_set_id=str(card.card_set_id),
|
||||
rooster_id=str(card.rooster_id),
|
||||
vendor_id=str(card.vendor_id)
|
||||
card_set_id=card.card_set_id,
|
||||
rooster_id=card.rooster_id,
|
||||
vendor_id=card.vendor_id
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -22,9 +22,9 @@ def to_response(cardset: CardSet) -> CardSetResponse:
|
||||
created_date=cardset.created_date,
|
||||
last_modified_date=cardset.last_modified_date,
|
||||
version=cardset.version,
|
||||
name=str(cardset.name),
|
||||
parallel_set=bool(cardset.parallel_set),
|
||||
insert_set=bool(cardset.insert_set),
|
||||
vendor_id=str(cardset.vendor_id)
|
||||
name=cardset.name,
|
||||
parallel_set=cardset.parallel_set,
|
||||
insert_set=cardset.insert_set,
|
||||
vendor_id=cardset.vendor_id
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -21,8 +21,8 @@ def to_response(fieldposition: FieldPosition) -> FieldPositionResponse:
|
||||
created_date=fieldposition.created_date,
|
||||
last_modified_date=fieldposition.last_modified_date,
|
||||
version=fieldposition.version,
|
||||
name=str(fieldposition.name),
|
||||
short_name=str(fieldposition.short_name),
|
||||
sport_id=str(fieldposition.sport_id)
|
||||
name=fieldposition.name,
|
||||
short_name=fieldposition.short_name,
|
||||
sport_id=fieldposition.sport_id
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -19,7 +19,7 @@ def to_response(player: Player) -> PlayerResponse:
|
||||
created_date=player.created_date,
|
||||
last_modified_date=player.last_modified_date,
|
||||
version=player.version,
|
||||
first_name=str(player.first_name),
|
||||
last_name=str(player.last_name)
|
||||
first_name=player.first_name,
|
||||
last_name=player.last_name
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -29,8 +29,8 @@ def to_response(rooster: Rooster) -> RoosterResponse:
|
||||
last_modified_date=rooster.last_modified_date,
|
||||
version=rooster.version,
|
||||
year=rooster.year,
|
||||
team_id=str(rooster.team_id),
|
||||
player_id=str(rooster.player_id),
|
||||
position_id=str(rooster.position_id)
|
||||
team_id=rooster.team_id,
|
||||
player_id=rooster.player_id,
|
||||
position_id=rooster.position_id
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -19,6 +19,6 @@ def to_response(sport: Sport) -> SportResponse:
|
||||
created_date=sport.created_date,
|
||||
last_modified_date=sport.last_modified_date,
|
||||
version=sport.version,
|
||||
name=str(sport.name)
|
||||
name=sport.name
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -21,8 +21,8 @@ def to_response(team: Team) -> TeamResponse:
|
||||
created_date=team.created_date,
|
||||
last_modified_date=team.last_modified_date,
|
||||
version=team.version,
|
||||
name=str(team.name),
|
||||
short_name=str(team.short_name),
|
||||
sport_id=str(team.sport_id)
|
||||
name=team.name,
|
||||
short_name=team.short_name,
|
||||
sport_id=team.sport_id
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -27,6 +27,6 @@ def to_response(vendor: Vendor) -> VendorResponse:
|
||||
created_date=vendor.created_date,
|
||||
last_modified_date=vendor.last_modified_date,
|
||||
version=vendor.version,
|
||||
name=str(vendor.name)
|
||||
name=vendor.name
|
||||
)
|
||||
return reponse
|
||||
|
||||
@@ -20,7 +20,7 @@ def to_response(assignment: Assignment) -> AssignmentResponse:
|
||||
created_date=assignment.created_date,
|
||||
last_modified_date=assignment.last_modified_date,
|
||||
version=assignment.version,
|
||||
profile_id=str(assignment.profile_id),
|
||||
permission_id=str(assignment.permission_id)
|
||||
profile_id=assignment.profile_id,
|
||||
permission_id=assignment.permission_id
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -19,6 +19,6 @@ def to_response(permission: Permission) -> PermissionResponse:
|
||||
created_date=permission.created_date,
|
||||
last_modified_date=permission.last_modified_date,
|
||||
version=permission.version,
|
||||
name=str(permission.name)
|
||||
name=permission.name
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -23,12 +23,12 @@ def to_response(profile: Profile) -> ProfileResponse:
|
||||
created_date=profile.created_date,
|
||||
last_modified_date=profile.last_modified_date,
|
||||
version=profile.version,
|
||||
first_name=str(profile.first_name),
|
||||
last_name=str(profile.last_name),
|
||||
user_name=str(profile.user_name),
|
||||
email=str(profile.email),
|
||||
password=str(profile.password),
|
||||
enabled=bool(profile.enabled)
|
||||
first_name=profile.first_name,
|
||||
last_name=profile.last_name,
|
||||
user_name=profile.user_name,
|
||||
email=profile.email,
|
||||
password=profile.password,
|
||||
enabled=profile.enabled
|
||||
)
|
||||
return response
|
||||
|
||||
|
||||
@@ -23,10 +23,10 @@ def to_response(token: Token) -> TokenResponse:
|
||||
created_date=token.created_date,
|
||||
last_modified_date=token.last_modified_date,
|
||||
version=token.version,
|
||||
token=str(token.token),
|
||||
name=str(token.name),
|
||||
token=token.token,
|
||||
name=token.name,
|
||||
last_used_date=token.last_used_date,
|
||||
enabled=bool(token.enabled),
|
||||
profile_id=str(token.profile_id)
|
||||
enabled=token.enabled,
|
||||
profile_id=token.profile_id
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -1,8 +1 @@
|
||||
<footer class="mt-auto py-3 bg-light fixed-bottom">
|
||||
<div class="container text-center">
|
||||
<span class="text-muted">{{ version }}</span>
|
||||
</div>
|
||||
</footer>
|
||||
<!-- Bootstrap JS einbinden -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="{{ url_for('static', path='js/autocomplete.js') }}"></script>
|
||||
<h2>Footer</h2>
|
||||
@@ -1,49 +1,10 @@
|
||||
<!-- <div class="topnav">
|
||||
<div class="topnav">
|
||||
<a href="/">Kontor</a>
|
||||
<a href="/comic/comics">Comics</a>
|
||||
<a href="/media/files">Media</a>
|
||||
<a style="float:right" href="/login/">Login</a></li>
|
||||
</div> -->
|
||||
|
||||
<nav class="navbar navbar-expand-lg navbar-dark" style="background-color:darkgrey;">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">Kontor</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarComicsMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Comics</a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarComicsMenuLink">
|
||||
<a class="dropdown-item" href="/comic/comics">Comics</a>
|
||||
<a class="dropdown-item" href="/comic/publishers">Publisher</a>
|
||||
<a class="dropdown-item" href="/comic/artists">Artist</a>
|
||||
<a class="dropdown-item" href="/comic/issues">Issue</a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarWebMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Media</a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarWebMenuLink">
|
||||
<a class="dropdown-item" href="/media/files">Media Files</a>
|
||||
<a class="dropdown-item" href="/media/actors">Media Actors</a>
|
||||
<a class="dropdown-item" href="/media/lofis">Lofi</a>
|
||||
<a class="dropdown-item" href="/media/articles">Artikel</a>
|
||||
</div>
|
||||
</li>
|
||||
{% if user %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/logout">Logout</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/login">Login</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<!-- <nav class="navbar navbar-expand-lg navbar-light bg-light px-5">
|
||||
<div class="container-fluid">
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
{% extends "shared/base.html" %}
|
||||
|
||||
|
||||
{% block title %}
|
||||
<title>Add a Lofi Link</title>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="text-danger font-weight-bold">
|
||||
{% for error in errors %}
|
||||
<li>{{error}}</li>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row my-5">
|
||||
<h3 class="text-center display-4">Add a Lofi Link</h3>
|
||||
<form method="POST">
|
||||
<div class="mb-3">
|
||||
<input type="text" required class="form-control" name="url" value="{{url}}" placeholder="Lofi Link here">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
{% extends "shared/base.html" %}
|
||||
|
||||
|
||||
{% block title %}
|
||||
<title>MediaLofi Detail</title>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1 class="display-5">MediaLofi Detail</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<table class="table table-striped table-hover">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">MediaLofi Title</th>
|
||||
<td colspan="2">{{medialofi.title}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">MediaLofi URL</th>
|
||||
<td colspan="2">{{medialofi.url}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">MediaLofi Download?</th>
|
||||
<td colspan="2">{{medialofi.should_download}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">MediaLofi Review?</th>
|
||||
<td colspan="2">{{medialofi.review}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Data Created</th>
|
||||
<td colspan="2">{{medialofi.created_date}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Data Modified</th>
|
||||
<td colspan="2">{{medialofi.last_modified_date}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Data Version</th>
|
||||
<td colspan="2">{{medialofi.version}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,62 +0,0 @@
|
||||
{% extends "shared/base.html" %}
|
||||
|
||||
{% block title %}
|
||||
<title>Lofi Links</title>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% with msg=msg %}
|
||||
{% include "components/alerts.html" %}
|
||||
{% endwith %}
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<h1>Media Lofi</h1>
|
||||
<p>Hier steht der wesentliche Inhalt der Seite.</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<aside class="bg-light p-3">
|
||||
<h3>Seitenbereich</h3>
|
||||
<p>Optionale Sidebar oder Zusatzinformationen.</p>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<form class="form-inline" action="/media/lofis">
|
||||
<input type="text" placeholder="Search" name="query">
|
||||
<label>
|
||||
<input type="checkbox" name="review" {% if review %}checked{% endif %}>Review
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="should_download" {% if download %}checked{% endif %}>Download
|
||||
</label>
|
||||
<button type="submit">Search</button>
|
||||
<div class="pill-nav"><a href="/media/lofis/add">Add Lofi</a></div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Title</th>
|
||||
<th scope="col">Weblink</th>
|
||||
<th scope="col">Review</th>
|
||||
<th colspan="2">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for medialofi in medialofis %}
|
||||
<tr>
|
||||
<th scope="row"><a href="/media/lofi/{{medialofi.id}}">{{medialofi.title}}</a></th>
|
||||
<td><a href="{{medialofi.url}}">{{medialofi.url}}</a></td>
|
||||
<td>{% with check=medialofi.review %}{% include "components/check.html" %}{% endwith %}</td>
|
||||
<td>{% with check=medialofi.should_download %}{% include "components/check.html" %}{% endwith %}</td>
|
||||
<td><a href="/media/lofi/{{medialofi.id}}/edit" class="btn btn-outline-primary btn-sm active" role="button" aria-pressed="true">Edit</a></td>
|
||||
<td><a href="/media/lofi/{{medialofi.id}}/delete" class="btn btn-outline-danger btn-sm active" role="button" aria-pressed="true">Delete</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -2,5 +2,4 @@
|
||||
<a href="/media/files/">MediaFiles</a>
|
||||
<a href="/media/actors/">MediaActors</a>
|
||||
<a href="/media/videos/">MediaVideos</a>
|
||||
<a href="/media/lofi/">MediaLofi</a>
|
||||
</div>
|
||||
|
||||
@@ -1,35 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de-DE">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
||||
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="{{ url_for('static', path='style.css') }}">
|
||||
{% block title %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
|
||||
<body class="d-flex flex-column h-100">
|
||||
<header>
|
||||
<body>
|
||||
<div class="header">
|
||||
{% block header %}
|
||||
{% endblock %}
|
||||
{% include "components/navbar.html" %}
|
||||
{% block subnav %}
|
||||
{% endblock %}
|
||||
</header>
|
||||
<main class="flex-shrink-0">
|
||||
<div class="container my-4">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
{% include "components/navbar.html" %}
|
||||
{% block subnav %}
|
||||
{% endblock %}
|
||||
<!-- <div class="topnav">
|
||||
<a href="#">Link</a>
|
||||
<a href="#">Link</a>
|
||||
<a href="#">Link</a>
|
||||
<a href="#" style="float:right">Link</a>
|
||||
</div> -->
|
||||
|
||||
{% include "components/footer.html" %}
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js" integrity="sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0" crossorigin="anonymous"></script>
|
||||
<script src="{{ url_for('static', path='js/autocomplete.js') }}"></script>
|
||||
{% block scripts %}
|
||||
{% endblock %}
|
||||
|
||||
<!-- <div class="row">
|
||||
<div class="leftcolumn">
|
||||
<div class="card">
|
||||
<h2>TITLE HEADING</h2>
|
||||
<h5>Title description, Dec 7, 2017</h5>
|
||||
<div class="fakeimg" style="height:200px;">Image</div>
|
||||
<p>Some text..</p>
|
||||
<p>Sunt in culpa qui officia deserunt mollit anim id est laborum consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco.</p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>TITLE HEADING</h2>
|
||||
<h5>Title description, Sep 2, 2017</h5>
|
||||
<div class="fakeimg" style="height:200px;">Image</div>
|
||||
<p>Some text..</p>
|
||||
<p>Sunt in culpa qui officia deserunt mollit anim id est laborum consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rightcolumn">
|
||||
<div class="card">
|
||||
<h2>About Me</h2>
|
||||
<div class="fakeimg" style="height:100px;">Image</div>
|
||||
<p>Some text about me in culpa qui officia deserunt mollit anim..</p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h3>Popular Post</h3>
|
||||
<div class="fakeimg"><p>Image</p></div>
|
||||
<div class="fakeimg"><p>Image</p></div>
|
||||
<div class="fakeimg"><p>Image</p></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h3>Follow Me</h3>
|
||||
<p>Some text..</p>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="footer">
|
||||
{% include "components/footer.html" %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -4,7 +4,7 @@ from fastapi.templating import Jinja2Templates
|
||||
from src.webapps.admin import route_admin
|
||||
from src.webapps.auth import route_login
|
||||
from src.webapps.comic import route_comics, route_worktype, route_artists
|
||||
from src.webapps.media import route_actors, route_lofi, route_media, route_videos
|
||||
from src.webapps.media import route_actors, route_media, route_videos
|
||||
|
||||
templates = Jinja2Templates(directory="src/templates")
|
||||
|
||||
@@ -15,7 +15,6 @@ api_router.include_router(route_worktype.router, tags=["webapp"])
|
||||
api_router.include_router(route_media.router, tags=["webapp"])
|
||||
api_router.include_router(route_actors.router, tags=["webapp"])
|
||||
api_router.include_router(route_videos.router, tags=["webapp"])
|
||||
api_router.include_router(route_lofi.router, tags=["webapp"])
|
||||
api_router.include_router(route_login.router, tags=["webapp"])
|
||||
api_router.include_router(route_admin.router, tags=["webapp"])
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ from typing import AnyStr
|
||||
from src.db.repository.comics.artist import update_artist
|
||||
from src.db.session import SessionDep
|
||||
#from src.db.repository.comic import create_new_worktype, update_worktype
|
||||
from src.main import logger
|
||||
from src.schema.comics.artist import AddArtist
|
||||
from src.webapps.comic.forms.artist import AddArtistForm
|
||||
|
||||
@@ -34,7 +35,7 @@ def edit_artist(db: SessionDep, request: Request, artist_id: str):
|
||||
return templates.TemplateResponse("comic/artist_edit.html", {"request": request, "artist_name": artist.name, "artist_link": artist.weblink})
|
||||
|
||||
@router.post("/artist/edit/{artist_id}")
|
||||
async def edit_artist_post(request: Request, db: SessionDep, artist_id: str, action: str = Form(...), artist_name: str = Form(...), artist_link: str = Form(...)):
|
||||
async def edit_artist(request: Request, db: SessionDep, artist_id: str, action: str = Form(...), artist_name: str = Form(...), artist_link: str = Form(...)):
|
||||
if action == "cancel":
|
||||
return RedirectResponse(f"/comic/artists/{artist_id}", status_code=status.HTTP_303_SEE_OTHER)
|
||||
form = AddArtistForm(request, artist_id, artist_name, artist_link)
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
from typing import Optional
|
||||
|
||||
from fastapi import APIRouter, Request, status, responses, Query
|
||||
from fastapi.security.utils import get_authorization_scheme_param
|
||||
from fastapi.templating import Jinja2Templates
|
||||
|
||||
from src.core.config import Settings
|
||||
from src.core.security import get_current_user_from_token
|
||||
from src.db.models.media import MediaLofi
|
||||
from src.db.models.admin import Profile
|
||||
from src.db.repository.media.lofi import create_new_lofi
|
||||
from src.db.session import SessionDep
|
||||
from src.webapps.media.forms import AddLinkForm
|
||||
|
||||
templates = Jinja2Templates(directory="src/templates")
|
||||
router = APIRouter(include_in_schema=False, prefix="/media")
|
||||
|
||||
@router.get("/lofis")
|
||||
def get_medialofis(db: SessionDep, request: Request, msg: Optional[str] = None, review: Optional[bool] = Query(default=False), download: Optional[bool] = Query(default=False)):
|
||||
medialofis = db.query(MediaLofi).all()
|
||||
try:
|
||||
token = request.cookies.get("access_token")
|
||||
_, param = get_authorization_scheme_param(token) # scheme will hold "Bearer" and param will hold actual token value
|
||||
current_user: Profile = get_current_user_from_token(token=param)
|
||||
request.params.get("review")
|
||||
return templates.TemplateResponse("media/lofi_list.html", {
|
||||
"request": request,
|
||||
"msg": msg,
|
||||
"user": current_user,
|
||||
"version": Settings.PROJECT_VERSION,
|
||||
"review": review,
|
||||
"download": download,
|
||||
"medialofis": medialofis,
|
||||
})
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return templates.TemplateResponse("media/lofi_list.html", {"request": request, "msg": msg, "user": None, "medialofis": medialofis})
|
||||
|
||||
@router.get("/lofis/{lofi_id}")
|
||||
def lofi_details(lofi_id: str, request: Request, db: SessionDep):
|
||||
medialofi = db.get(MediaLofi, lofi_id)
|
||||
return templates.TemplateResponse("media/lofi_detail.html", {"request": request, "medialofi":medialofi})
|
||||
|
||||
@router.get("/lofis/add")
|
||||
def add_lofi_link(request: Request, db: SessionDep):
|
||||
return templates.TemplateResponse("media/add_lofi_link.html", {"request": request})
|
||||
|
||||
@router.post("/lofis/add")
|
||||
async def post_lofi_link(request: Request, db: SessionDep):
|
||||
form = AddLinkForm(request)
|
||||
await form.load_data()
|
||||
if form.is_valid():
|
||||
try:
|
||||
#video = AddLink(**form.__dict__)
|
||||
medialofi = create_new_lofi(url=str(form.url), db=db)
|
||||
return responses.RedirectResponse(f"media/lofi/{medialofi.id}", status_code=status.HTTP_302_FOUND)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
form.__dict__.get("errors").append("Link already added")
|
||||
return templates.TemplateResponse("media/add_lofi_link.html", form.__dict__)
|
||||
return templates.TemplateResponse("media/add_lofi_link.html", form.__dict__)
|
||||
@@ -37,7 +37,7 @@ def get_mediafiles(db: SessionDep, request: Request, msg: str | None = None):
|
||||
try:
|
||||
token = request.cookies.get("access_token")
|
||||
scheme, param = get_authorization_scheme_param(token) # scheme will hold "Bearer" and param will hold actual token value
|
||||
#current_user: Profile = get_current_user_from_token(token=param)
|
||||
current_user: Profile = get_current_user_from_token(token=param)
|
||||
return templates.TemplateResponse("media/files.html", {"request": request, "msg": msg, "mediafiles": mediafiles})
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from typing import Optional
|
||||
|
||||
from fastapi import APIRouter, Request, status, responses
|
||||
from fastapi.security.utils import get_authorization_scheme_param
|
||||
from fastapi.templating import Jinja2Templates
|
||||
@@ -15,12 +13,12 @@ templates = Jinja2Templates(directory="src/templates")
|
||||
router = APIRouter(include_in_schema=False, prefix="/media")
|
||||
|
||||
@router.get("/videos")
|
||||
def get_mediavideos(db: SessionDep, request: Request, msg: Optional[str] = None):
|
||||
def get_mediavideos(db: SessionDep, request: Request, msg: str = None):
|
||||
mediavideos = db.query(MediaVideo).all()
|
||||
try:
|
||||
token = request.cookies.get("access_token")
|
||||
_, param = get_authorization_scheme_param(token) # scheme will hold "Bearer" and param will hold actual token value
|
||||
current_user: Profile = get_current_user_from_token(token=param)
|
||||
current_user: Profile = get_current_user_from_token(token=param, db=db)
|
||||
return templates.TemplateResponse("media/videos.html", {"request": request, "msg": msg, "user": current_user, "mediavideos": mediavideos})
|
||||
except Exception as e:
|
||||
print(e)
|
||||
@@ -42,7 +40,7 @@ async def post_video_link(request: Request, db: SessionDep):
|
||||
if form.is_valid():
|
||||
try:
|
||||
#video = AddLink(**form.__dict__)
|
||||
mediavideo = create_new_video(url=str(form.url), db=db)
|
||||
mediavideo = create_new_video(video=form, db=db)
|
||||
return responses.RedirectResponse(f"media/videos/{mediavideo.id}", status_code=status.HTTP_302_FOUND)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
Generated
+473
-1192
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,6 @@
|
||||
def main():
|
||||
print("Hello from kontor-blacksheep!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,17 @@
|
||||
from piccolo.conf.apps import AppRegistry
|
||||
from piccolo.engine.postgres import PostgresEngine
|
||||
|
||||
DB = PostgresEngine(
|
||||
config={
|
||||
"database": "api_project",
|
||||
"user": "api_project",
|
||||
"password": "api_project",
|
||||
"host": "localhost",
|
||||
"port": 5432,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
# A list of paths to piccolo apps
|
||||
# e.g. ['blog.piccolo_app']
|
||||
APP_REGISTRY = AppRegistry(apps=["sql_app.piccolo_app"])
|
||||
@@ -0,0 +1,9 @@
|
||||
[project]
|
||||
name = "kontor-blacksheep"
|
||||
version = "0.1.0"
|
||||
description = "Add your description here"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.13"
|
||||
dependencies = [
|
||||
"piccolo[postgres]>=1.34.0",
|
||||
]
|
||||
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
Import all of the Tables subclasses in your app here, and register them with
|
||||
the APP_CONFIG.
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from piccolo.conf.apps import AppConfig, get_package, table_finder
|
||||
|
||||
CURRENT_DIRECTORY = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
APP_CONFIG = AppConfig(
|
||||
app_name="sql_app",
|
||||
migrations_folder_path=os.path.join(CURRENT_DIRECTORY, "piccolo_migrations"),
|
||||
table_classes=table_finder(
|
||||
modules=[".tables"],
|
||||
package=get_package(__name__),
|
||||
exclude_imported=True,
|
||||
),
|
||||
migration_dependencies=[],
|
||||
commands=[],
|
||||
)
|
||||
@@ -0,0 +1,12 @@
|
||||
from piccolo.colmns import Integer, Varchar
|
||||
from piccolo.table import Table
|
||||
|
||||
|
||||
class Expense(Table):
|
||||
amount = Integer()
|
||||
description = Varchar()
|
||||
|
||||
|
||||
class Item(Table):
|
||||
id = Varchar(primary_key=True, default=uuid.uuid4())
|
||||
description = Text()
|
||||
Generated
+409
@@ -0,0 +1,409 @@
|
||||
version = 1
|
||||
revision = 3
|
||||
requires-python = ">=3.13"
|
||||
|
||||
[[package]]
|
||||
name = "annotated-types"
|
||||
version = "0.7.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "asyncpg"
|
||||
version = "0.31.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/fe/cc/d18065ce2380d80b1bcce927c24a2642efd38918e33fd724bc4bca904877/asyncpg-0.31.0.tar.gz", hash = "sha256:c989386c83940bfbd787180f2b1519415e2d3d6277a70d9d0f0145ac73500735", size = 993667, upload-time = "2025-11-24T23:27:00.812Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/95/11/97b5c2af72a5d0b9bc3fa30cd4b9ce22284a9a943a150fdc768763caf035/asyncpg-0.31.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:c204fab1b91e08b0f47e90a75d1b3c62174dab21f670ad6c5d0f243a228f015b", size = 661111, upload-time = "2025-11-24T23:26:04.467Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1b/71/157d611c791a5e2d0423f09f027bd499935f0906e0c2a416ce712ba51ef3/asyncpg-0.31.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:54a64f91839ba59008eccf7aad2e93d6e3de688d796f35803235ea1c4898ae1e", size = 636928, upload-time = "2025-11-24T23:26:05.944Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2e/fc/9e3486fb2bbe69d4a867c0b76d68542650a7ff1574ca40e84c3111bb0c6e/asyncpg-0.31.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c0e0822b1038dc7253b337b0f3f676cadc4ac31b126c5d42691c39691962e403", size = 3424067, upload-time = "2025-11-24T23:26:07.957Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/12/c6/8c9d076f73f07f995013c791e018a1cd5f31823c2a3187fc8581706aa00f/asyncpg-0.31.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bef056aa502ee34204c161c72ca1f3c274917596877f825968368b2c33f585f4", size = 3518156, upload-time = "2025-11-24T23:26:09.591Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ae/3b/60683a0baf50fbc546499cfb53132cb6835b92b529a05f6a81471ab60d0c/asyncpg-0.31.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0bfbcc5b7ffcd9b75ab1558f00db2ae07db9c80637ad1b2469c43df79d7a5ae2", size = 3319636, upload-time = "2025-11-24T23:26:11.168Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/50/dc/8487df0f69bd398a61e1792b3cba0e47477f214eff085ba0efa7eac9ce87/asyncpg-0.31.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:22bc525ebbdc24d1261ecbf6f504998244d4e3be1721784b5f64664d61fbe602", size = 3472079, upload-time = "2025-11-24T23:26:13.164Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/13/a1/c5bbeeb8531c05c89135cb8b28575ac2fac618bcb60119ee9696c3faf71c/asyncpg-0.31.0-cp313-cp313-win32.whl", hash = "sha256:f890de5e1e4f7e14023619399a471ce4b71f5418cd67a51853b9910fdfa73696", size = 527606, upload-time = "2025-11-24T23:26:14.78Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/91/66/b25ccb84a246b470eb943b0107c07edcae51804912b824054b3413995a10/asyncpg-0.31.0-cp313-cp313-win_amd64.whl", hash = "sha256:dc5f2fa9916f292e5c5c8b2ac2813763bcd7f58e130055b4ad8a0531314201ab", size = 596569, upload-time = "2025-11-24T23:26:16.189Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3c/36/e9450d62e84a13aea6580c83a47a437f26c7ca6fa0f0fd40b6670793ea30/asyncpg-0.31.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:f6b56b91bb0ffc328c4e3ed113136cddd9deefdf5f79ab448598b9772831df44", size = 660867, upload-time = "2025-11-24T23:26:17.631Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/82/4b/1d0a2b33b3102d210439338e1beea616a6122267c0df459ff0265cd5807a/asyncpg-0.31.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:334dec28cf20d7f5bb9e45b39546ddf247f8042a690bff9b9573d00086e69cb5", size = 638349, upload-time = "2025-11-24T23:26:19.689Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/41/aa/e7f7ac9a7974f08eff9183e392b2d62516f90412686532d27e196c0f0eeb/asyncpg-0.31.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:98cc158c53f46de7bb677fd20c417e264fc02b36d901cc2a43bd6cb0dc6dbfd2", size = 3410428, upload-time = "2025-11-24T23:26:21.275Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6f/de/bf1b60de3dede5c2731e6788617a512bc0ebd9693eac297ee74086f101d7/asyncpg-0.31.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9322b563e2661a52e3cdbc93eed3be7748b289f792e0011cb2720d278b366ce2", size = 3471678, upload-time = "2025-11-24T23:26:23.627Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/46/78/fc3ade003e22d8bd53aaf8f75f4be48f0b460fa73738f0391b9c856a9147/asyncpg-0.31.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:19857a358fc811d82227449b7ca40afb46e75b33eb8897240c3839dd8b744218", size = 3313505, upload-time = "2025-11-24T23:26:25.235Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bf/e9/73eb8a6789e927816f4705291be21f2225687bfa97321e40cd23055e903a/asyncpg-0.31.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ba5f8886e850882ff2c2ace5732300e99193823e8107e2c53ef01c1ebfa1e85d", size = 3434744, upload-time = "2025-11-24T23:26:26.944Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/08/4b/f10b880534413c65c5b5862f79b8e81553a8f364e5238832ad4c0af71b7f/asyncpg-0.31.0-cp314-cp314-win32.whl", hash = "sha256:cea3a0b2a14f95834cee29432e4ddc399b95700eb1d51bbc5bfee8f31fa07b2b", size = 532251, upload-time = "2025-11-24T23:26:28.404Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d3/2d/7aa40750b7a19efa5d66e67fc06008ca0f27ba1bd082e457ad82f59aba49/asyncpg-0.31.0-cp314-cp314-win_amd64.whl", hash = "sha256:04d19392716af6b029411a0264d92093b6e5e8285ae97a39957b9a9c14ea72be", size = 604901, upload-time = "2025-11-24T23:26:30.34Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ce/fe/b9dfe349b83b9dee28cc42360d2c86b2cdce4cb551a2c2d27e156bcac84d/asyncpg-0.31.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:bdb957706da132e982cc6856bb2f7b740603472b54c3ebc77fe60ea3e57e1bd2", size = 702280, upload-time = "2025-11-24T23:26:32Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6a/81/e6be6e37e560bd91e6c23ea8a6138a04fd057b08cf63d3c5055c98e81c1d/asyncpg-0.31.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:6d11b198111a72f47154fa03b85799f9be63701e068b43f84ac25da0bda9cb31", size = 682931, upload-time = "2025-11-24T23:26:33.572Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a6/45/6009040da85a1648dd5bc75b3b0a062081c483e75a1a29041ae63a0bf0dc/asyncpg-0.31.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:18c83b03bc0d1b23e6230f5bf8d4f217dc9bc08644ce0502a9d91dc9e634a9c7", size = 3581608, upload-time = "2025-11-24T23:26:35.638Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7e/06/2e3d4d7608b0b2b3adbee0d0bd6a2d29ca0fc4d8a78f8277df04e2d1fd7b/asyncpg-0.31.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e009abc333464ff18b8f6fd146addffd9aaf63e79aa3bb40ab7a4c332d0c5e9e", size = 3498738, upload-time = "2025-11-24T23:26:37.275Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7d/aa/7d75ede780033141c51d83577ea23236ba7d3a23593929b32b49db8ed36e/asyncpg-0.31.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:3b1fbcb0e396a5ca435a8826a87e5c2c2cc0c8c68eb6fadf82168056b0e53a8c", size = 3401026, upload-time = "2025-11-24T23:26:39.423Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ba/7a/15e37d45e7f7c94facc1e9148c0e455e8f33c08f0b8a0b1deb2c5171771b/asyncpg-0.31.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8df714dba348efcc162d2adf02d213e5fab1bd9f557e1305633e851a61814a7a", size = 3429426, upload-time = "2025-11-24T23:26:41.032Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/13/d5/71437c5f6ae5f307828710efbe62163974e71237d5d46ebd2869ea052d10/asyncpg-0.31.0-cp314-cp314t-win32.whl", hash = "sha256:1b41f1afb1033f2b44f3234993b15096ddc9cd71b21a42dbd87fc6a57b43d65d", size = 614495, upload-time = "2025-11-24T23:26:42.659Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3c/d7/8fb3044eaef08a310acfe23dae9a8e2e07d305edc29a53497e52bc76eca7/asyncpg-0.31.0-cp314-cp314t-win_amd64.whl", hash = "sha256:bd4107bb7cdd0e9e65fae66a62afd3a249663b844fa34d479f6d5b3bef9c04c3", size = 706062, upload-time = "2025-11-24T23:26:44.086Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "black"
|
||||
version = "26.5.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "click" },
|
||||
{ name = "mypy-extensions" },
|
||||
{ name = "packaging" },
|
||||
{ name = "pathspec" },
|
||||
{ name = "platformdirs" },
|
||||
{ name = "pytokens" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/c0/37/5628dd55bf2b34257fc7603f0fe97c40e3aaf24265f416a9c85c95ca1436/black-26.5.1.tar.gz", hash = "sha256:dd321f668053961824bcc1be1cc1df748b2d7e4fa28086b08331e577b0100a73", size = 679439, upload-time = "2026-05-18T16:53:36.107Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/3f/5c/c384363980e11e25ca6b93205949bb331fbf35f4e0dbec376dfa6326cec8/black-26.5.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:2b36cf2ddf5566e205f6535f782a62194a184d33e175b64ae8c40b1737522be3", size = 2009020, upload-time = "2026-05-18T17:05:28.132Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0b/df/9f31c5e0babbfed77d505fc5d120beb98b21b33feaeded3924ea941fe360/black-26.5.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1f7ea64ebfa01b50f693508fc39f875e264446d3b097088f84f203b9d09618a0", size = 1813335, upload-time = "2026-05-18T17:05:31.266Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fb/24/8e7b9a2fa61b0afd82209efe937557d180a1fa055bd7f6161eb9defc3719/black-26.5.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ecb3e624844c798144e9bd986954e0adc81d8911a1f30f375e1252fe26e8c294", size = 1881614, upload-time = "2026-05-18T17:05:32.718Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/49/ad/b4e0d9365ba8ac34f6bbab62a4b1b2dd5d618fac3fa1b8db968c844201b5/black-26.5.1-cp313-cp313-win_amd64.whl", hash = "sha256:e1a26503279b6b310669fb0b219c39e4820b77e8189fe80f522bb511f247db0a", size = 1488925, upload-time = "2026-05-18T17:05:34.259Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a1/4b/652b859bf5df88a751c30451b09338f7fd26a77d1271c666992f836b7711/black-26.5.1-cp313-cp313-win_arm64.whl", hash = "sha256:5c34b25da232ead53a6f335b76dbea124f4d152ad568b9080d6f944bc2b34b52", size = 1289883, upload-time = "2026-05-18T17:05:36.019Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a6/16/a8da8eb208c51c7f4ce74609a45d0dcc6d8a2141e45e81ee5289d1bb0d59/black-26.5.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:e88976690a64b0af98312ca958415849cb42423423c5f2ee74af4b49a97a2168", size = 2004800, upload-time = "2026-05-18T17:05:38.182Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/11/8a/a479296a19e383b70a725882a6cf3d786540601ff03cabbaaf1cce864c5a/black-26.5.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:32d5ea7f6c8bdfa6e648326ebca1f02b0764e2a029edc6f8dce2627e19d468c3", size = 1815576, upload-time = "2026-05-18T17:05:40.309Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/81/6b/cfaf3d39f25132c156a068f6b805576c9103a84086019507c70e1911ee7d/black-26.5.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ea8d16dc41655aa113cd64665e7219446cd7e4ff2248d7178eaa905190c86b18", size = 1877927, upload-time = "2026-05-18T17:05:42.463Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/66/76/302e313964bcff7e28df329d39f84f5270095730d85ff0acc260610a0d82/black-26.5.1-cp314-cp314-win_amd64.whl", hash = "sha256:577f21094ea469ef92ec1adaf2c9441a226d2144d01a5be2fa823cecf6543e50", size = 1511860, upload-time = "2026-05-18T17:05:43.943Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/27/4e/a3827e35e0e567f9f9ee59e2a0ab979267dca98718f25547ca8c6733afd4/black-26.5.1-cp314-cp314-win_arm64.whl", hash = "sha256:ed1a20af114c301a0269bf01163d51dbef72737fd65f850001e7cbe7f3c7abae", size = 1316632, upload-time = "2026-05-18T17:05:45.521Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/94/51/f975cae76d44274cc2868dc9040ac5d58d464784610234455b4e7b19c6ef/black-26.5.1-py3-none-any.whl", hash = "sha256:4ed7f7da04046d2e488437170797d3b4a4ad83906683bcb7dfc68b673bbce5e2", size = 213693, upload-time = "2026-05-18T16:53:33.964Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "click"
|
||||
version = "8.4.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/9b/98/518d8e5081007684232226f475082b30087d0f585e8457db087298259f49/click-8.4.1.tar.gz", hash = "sha256:918b5633eddf6b41c32d4f454bf0de810065c74e3f7dbf8ee5452f8be88d3e96", size = 353007, upload-time = "2026-05-22T04:08:37.769Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/c7/0d/67e5b4109ea4a837e80daa87c2c696711955e40449a97e8926672534def2/click-8.4.1-py3-none-any.whl", hash = "sha256:482be17c6991b8c19c5429a1e995d9b0efdbb63172824c41f99965dc0ade8ec2", size = 116639, upload-time = "2026-05-22T04:08:35.26Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "colorama"
|
||||
version = "0.4.6"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dnspython"
|
||||
version = "2.8.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/8c/8b/57666417c0f90f08bcafa776861060426765fdb422eb10212086fb811d26/dnspython-2.8.0.tar.gz", hash = "sha256:181d3c6996452cb1189c4046c61599b84a5a86e099562ffde77d26984ff26d0f", size = 368251, upload-time = "2025-09-07T18:58:00.022Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/ba/5a/18ad964b0086c6e62e2e7500f7edc89e3faa45033c71c1893d34eed2b2de/dnspython-2.8.0-py3-none-any.whl", hash = "sha256:01d9bbc4a2d76bf0db7c1f729812ded6d912bd318d3b1cf81d30c0f845dbf3af", size = 331094, upload-time = "2025-09-07T18:57:58.071Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "docstring-parser"
|
||||
version = "0.18.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/e0/4d/f332313098c1de1b2d2ff91cf2674415cc7cddab2ca1b01ae29774bd5fdf/docstring_parser-0.18.0.tar.gz", hash = "sha256:292510982205c12b1248696f44959db3cdd1740237a968ea1e2e7a900eeb2015", size = 29341, upload-time = "2026-04-14T04:09:19.867Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/a7/5f/ed01f9a3cdffbd5a008556fc7b2a08ddb1cc6ace7effa7340604b1d16699/docstring_parser-0.18.0-py3-none-any.whl", hash = "sha256:b3fcbed555c47d8479be0796ef7e19c2670d428d72e96da63f3a40122860374b", size = 22484, upload-time = "2026-04-14T04:09:18.638Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "email-validator"
|
||||
version = "2.3.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "dnspython" },
|
||||
{ name = "idna" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/f5/22/900cb125c76b7aaa450ce02fd727f452243f2e91a61af068b40adba60ea9/email_validator-2.3.0.tar.gz", hash = "sha256:9fc05c37f2f6cf439ff414f8fc46d917929974a82244c20eb10231ba60c54426", size = 51238, upload-time = "2025-08-26T13:09:06.831Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/de/15/545e2b6cf2e3be84bc1ed85613edd75b8aea69807a71c26f4ca6a9258e82/email_validator-2.3.0-py3-none-any.whl", hash = "sha256:80f13f623413e6b197ae73bb10bf4eb0908faf509ad8362c5edeb0be7fd450b4", size = 35604, upload-time = "2025-08-26T13:09:05.858Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "3.18"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/cd/63/9496c57188a2ee585e0f1db071d75089a11e98aa86eb99d9d7618fc1edce/idna-3.18.tar.gz", hash = "sha256:ffb385a7e039654cef1ab9ef32c6fafe283c0c0467bba1d9029738ce4a14a848", size = 196711, upload-time = "2026-06-02T14:34:07.794Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/1e/5e/d4e9f1a599fb8e573b7b87160658329fbf28d19eac2718f51fc3def3aa5a/idna-3.18-py3-none-any.whl", hash = "sha256:7f952cbe720b688055e3f87de14f5c3e5fdaa8bc3928985c4077ca689de849a2", size = 65455, upload-time = "2026-06-02T14:34:06.319Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "inflection"
|
||||
version = "0.5.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/e1/7e/691d061b7329bc8d54edbf0ec22fbfb2afe61facb681f9aaa9bff7a27d04/inflection-0.5.1.tar.gz", hash = "sha256:1a29730d366e996aaacffb2f1f1cb9593dc38e2ddd30c91250c6dde09ea9b417", size = 15091, upload-time = "2020-08-22T08:16:29.139Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/59/91/aa6bde563e0085a02a435aa99b49ef75b0a4b062635e606dab23ce18d720/inflection-0.5.1-py2.py3-none-any.whl", hash = "sha256:f38b2b640938a4f35ade69ac3d053042959b62a0f1076a5bbaa1b9526605a8a2", size = 9454, upload-time = "2020-08-22T08:16:27.816Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jinja2"
|
||||
version = "3.1.6"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "markupsafe" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kontor-blacksheep"
|
||||
version = "0.1.0"
|
||||
source = { virtual = "." }
|
||||
dependencies = [
|
||||
{ name = "piccolo", extra = ["postgres"] },
|
||||
]
|
||||
|
||||
[package.metadata]
|
||||
requires-dist = [{ name = "piccolo", extras = ["postgres"], specifier = ">=1.34.0" }]
|
||||
|
||||
[[package]]
|
||||
name = "markupsafe"
|
||||
version = "3.0.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/38/2f/907b9c7bbba283e68f20259574b13d005c121a0fa4c175f9bed27c4597ff/markupsafe-3.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e1cf1972137e83c5d4c136c43ced9ac51d0e124706ee1c8aa8532c1287fa8795", size = 11622, upload-time = "2025-09-27T18:36:41.777Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9c/d9/5f7756922cdd676869eca1c4e3c0cd0df60ed30199ffd775e319089cb3ed/markupsafe-3.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:116bb52f642a37c115f517494ea5feb03889e04df47eeff5b130b1808ce7c219", size = 12029, upload-time = "2025-09-27T18:36:43.257Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/00/07/575a68c754943058c78f30db02ee03a64b3c638586fba6a6dd56830b30a3/markupsafe-3.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:133a43e73a802c5562be9bbcd03d090aa5a1fe899db609c29e8c8d815c5f6de6", size = 24374, upload-time = "2025-09-27T18:36:44.508Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a9/21/9b05698b46f218fc0e118e1f8168395c65c8a2c750ae2bab54fc4bd4e0e8/markupsafe-3.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ccfcd093f13f0f0b7fdd0f198b90053bf7b2f02a3927a30e63f3ccc9df56b676", size = 22980, upload-time = "2025-09-27T18:36:45.385Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7f/71/544260864f893f18b6827315b988c146b559391e6e7e8f7252839b1b846a/markupsafe-3.0.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:509fa21c6deb7a7a273d629cf5ec029bc209d1a51178615ddf718f5918992ab9", size = 21990, upload-time = "2025-09-27T18:36:46.916Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c2/28/b50fc2f74d1ad761af2f5dcce7492648b983d00a65b8c0e0cb457c82ebbe/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4afe79fb3de0b7097d81da19090f4df4f8d3a2b3adaa8764138aac2e44f3af1", size = 23784, upload-time = "2025-09-27T18:36:47.884Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ed/76/104b2aa106a208da8b17a2fb72e033a5a9d7073c68f7e508b94916ed47a9/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:795e7751525cae078558e679d646ae45574b47ed6e7771863fcc079a6171a0fc", size = 21588, upload-time = "2025-09-27T18:36:48.82Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b5/99/16a5eb2d140087ebd97180d95249b00a03aa87e29cc224056274f2e45fd6/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8485f406a96febb5140bfeca44a73e3ce5116b2501ac54fe953e488fb1d03b12", size = 23041, upload-time = "2025-09-27T18:36:49.797Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/19/bc/e7140ed90c5d61d77cea142eed9f9c303f4c4806f60a1044c13e3f1471d0/markupsafe-3.0.3-cp313-cp313-win32.whl", hash = "sha256:bdd37121970bfd8be76c5fb069c7751683bdf373db1ed6c010162b2a130248ed", size = 14543, upload-time = "2025-09-27T18:36:51.584Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/05/73/c4abe620b841b6b791f2edc248f556900667a5a1cf023a6646967ae98335/markupsafe-3.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:9a1abfdc021a164803f4d485104931fb8f8c1efd55bc6b748d2f5774e78b62c5", size = 15113, upload-time = "2025-09-27T18:36:52.537Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f0/3a/fa34a0f7cfef23cf9500d68cb7c32dd64ffd58a12b09225fb03dd37d5b80/markupsafe-3.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:7e68f88e5b8799aa49c85cd116c932a1ac15caaa3f5db09087854d218359e485", size = 13911, upload-time = "2025-09-27T18:36:53.513Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e4/d7/e05cd7efe43a88a17a37b3ae96e79a19e846f3f456fe79c57ca61356ef01/markupsafe-3.0.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:218551f6df4868a8d527e3062d0fb968682fe92054e89978594c28e642c43a73", size = 11658, upload-time = "2025-09-27T18:36:54.819Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/99/9e/e412117548182ce2148bdeacdda3bb494260c0b0184360fe0d56389b523b/markupsafe-3.0.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3524b778fe5cfb3452a09d31e7b5adefeea8c5be1d43c4f810ba09f2ceb29d37", size = 12066, upload-time = "2025-09-27T18:36:55.714Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bc/e6/fa0ffcda717ef64a5108eaa7b4f5ed28d56122c9a6d70ab8b72f9f715c80/markupsafe-3.0.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e885a3d1efa2eadc93c894a21770e4bc67899e3543680313b09f139e149ab19", size = 25639, upload-time = "2025-09-27T18:36:56.908Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/96/ec/2102e881fe9d25fc16cb4b25d5f5cde50970967ffa5dddafdb771237062d/markupsafe-3.0.3-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8709b08f4a89aa7586de0aadc8da56180242ee0ada3999749b183aa23df95025", size = 23569, upload-time = "2025-09-27T18:36:57.913Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4b/30/6f2fce1f1f205fc9323255b216ca8a235b15860c34b6798f810f05828e32/markupsafe-3.0.3-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b8512a91625c9b3da6f127803b166b629725e68af71f8184ae7e7d54686a56d6", size = 23284, upload-time = "2025-09-27T18:36:58.833Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/58/47/4a0ccea4ab9f5dcb6f79c0236d954acb382202721e704223a8aafa38b5c8/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9b79b7a16f7fedff2495d684f2b59b0457c3b493778c9eed31111be64d58279f", size = 24801, upload-time = "2025-09-27T18:36:59.739Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6a/70/3780e9b72180b6fecb83a4814d84c3bf4b4ae4bf0b19c27196104149734c/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:12c63dfb4a98206f045aa9563db46507995f7ef6d83b2f68eda65c307c6829eb", size = 22769, upload-time = "2025-09-27T18:37:00.719Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/98/c5/c03c7f4125180fc215220c035beac6b9cb684bc7a067c84fc69414d315f5/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8f71bc33915be5186016f675cd83a1e08523649b0e33efdb898db577ef5bb009", size = 23642, upload-time = "2025-09-27T18:37:01.673Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/80/d6/2d1b89f6ca4bff1036499b1e29a1d02d282259f3681540e16563f27ebc23/markupsafe-3.0.3-cp313-cp313t-win32.whl", hash = "sha256:69c0b73548bc525c8cb9a251cddf1931d1db4d2258e9599c28c07ef3580ef354", size = 14612, upload-time = "2025-09-27T18:37:02.639Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2b/98/e48a4bfba0a0ffcf9925fe2d69240bfaa19c6f7507b8cd09c70684a53c1e/markupsafe-3.0.3-cp313-cp313t-win_amd64.whl", hash = "sha256:1b4b79e8ebf6b55351f0d91fe80f893b4743f104bff22e90697db1590e47a218", size = 15200, upload-time = "2025-09-27T18:37:03.582Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0e/72/e3cc540f351f316e9ed0f092757459afbc595824ca724cbc5a5d4263713f/markupsafe-3.0.3-cp313-cp313t-win_arm64.whl", hash = "sha256:ad2cf8aa28b8c020ab2fc8287b0f823d0a7d8630784c31e9ee5edea20f406287", size = 13973, upload-time = "2025-09-27T18:37:04.929Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/33/8a/8e42d4838cd89b7dde187011e97fe6c3af66d8c044997d2183fbd6d31352/markupsafe-3.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:eaa9599de571d72e2daf60164784109f19978b327a3910d3e9de8c97b5b70cfe", size = 11619, upload-time = "2025-09-27T18:37:06.342Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b5/64/7660f8a4a8e53c924d0fa05dc3a55c9cee10bbd82b11c5afb27d44b096ce/markupsafe-3.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c47a551199eb8eb2121d4f0f15ae0f923d31350ab9280078d1e5f12b249e0026", size = 12029, upload-time = "2025-09-27T18:37:07.213Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/da/ef/e648bfd021127bef5fa12e1720ffed0c6cbb8310c8d9bea7266337ff06de/markupsafe-3.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f34c41761022dd093b4b6896d4810782ffbabe30f2d443ff5f083e0cbbb8c737", size = 24408, upload-time = "2025-09-27T18:37:09.572Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/41/3c/a36c2450754618e62008bf7435ccb0f88053e07592e6028a34776213d877/markupsafe-3.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:457a69a9577064c05a97c41f4e65148652db078a3a509039e64d3467b9e7ef97", size = 23005, upload-time = "2025-09-27T18:37:10.58Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bc/20/b7fdf89a8456b099837cd1dc21974632a02a999ec9bf7ca3e490aacd98e7/markupsafe-3.0.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e8afc3f2ccfa24215f8cb28dcf43f0113ac3c37c2f0f0806d8c70e4228c5cf4d", size = 22048, upload-time = "2025-09-27T18:37:11.547Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9a/a7/591f592afdc734f47db08a75793a55d7fbcc6902a723ae4cfbab61010cc5/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ec15a59cf5af7be74194f7ab02d0f59a62bdcf1a537677ce67a2537c9b87fcda", size = 23821, upload-time = "2025-09-27T18:37:12.48Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7d/33/45b24e4f44195b26521bc6f1a82197118f74df348556594bd2262bda1038/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:0eb9ff8191e8498cca014656ae6b8d61f39da5f95b488805da4bb029cccbfbaf", size = 21606, upload-time = "2025-09-27T18:37:13.485Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ff/0e/53dfaca23a69fbfbbf17a4b64072090e70717344c52eaaaa9c5ddff1e5f0/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2713baf880df847f2bece4230d4d094280f4e67b1e813eec43b4c0e144a34ffe", size = 23043, upload-time = "2025-09-27T18:37:14.408Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/46/11/f333a06fc16236d5238bfe74daccbca41459dcd8d1fa952e8fbd5dccfb70/markupsafe-3.0.3-cp314-cp314-win32.whl", hash = "sha256:729586769a26dbceff69f7a7dbbf59ab6572b99d94576a5592625d5b411576b9", size = 14747, upload-time = "2025-09-27T18:37:15.36Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/28/52/182836104b33b444e400b14f797212f720cbc9ed6ba34c800639d154e821/markupsafe-3.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:bdc919ead48f234740ad807933cdf545180bfbe9342c2bb451556db2ed958581", size = 15341, upload-time = "2025-09-27T18:37:16.496Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6f/18/acf23e91bd94fd7b3031558b1f013adfa21a8e407a3fdb32745538730382/markupsafe-3.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:5a7d5dc5140555cf21a6fefbdbf8723f06fcd2f63ef108f2854de715e4422cb4", size = 14073, upload-time = "2025-09-27T18:37:17.476Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3c/f0/57689aa4076e1b43b15fdfa646b04653969d50cf30c32a102762be2485da/markupsafe-3.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:1353ef0c1b138e1907ae78e2f6c63ff67501122006b0f9abad68fda5f4ffc6ab", size = 11661, upload-time = "2025-09-27T18:37:18.453Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/89/c3/2e67a7ca217c6912985ec766c6393b636fb0c2344443ff9d91404dc4c79f/markupsafe-3.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1085e7fbddd3be5f89cc898938f42c0b3c711fdcb37d75221de2666af647c175", size = 12069, upload-time = "2025-09-27T18:37:19.332Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f0/00/be561dce4e6ca66b15276e184ce4b8aec61fe83662cce2f7d72bd3249d28/markupsafe-3.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1b52b4fb9df4eb9ae465f8d0c228a00624de2334f216f178a995ccdcf82c4634", size = 25670, upload-time = "2025-09-27T18:37:20.245Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/50/09/c419f6f5a92e5fadde27efd190eca90f05e1261b10dbd8cbcb39cd8ea1dc/markupsafe-3.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50", size = 23598, upload-time = "2025-09-27T18:37:21.177Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/22/44/a0681611106e0b2921b3033fc19bc53323e0b50bc70cffdd19f7d679bb66/markupsafe-3.0.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f190daf01f13c72eac4efd5c430a8de82489d9cff23c364c3ea822545032993e", size = 23261, upload-time = "2025-09-27T18:37:22.167Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5f/57/1b0b3f100259dc9fffe780cfb60d4be71375510e435efec3d116b6436d43/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e56b7d45a839a697b5eb268c82a71bd8c7f6c94d6fd50c3d577fa39a9f1409f5", size = 24835, upload-time = "2025-09-27T18:37:23.296Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/26/6a/4bf6d0c97c4920f1597cc14dd720705eca0bf7c787aebc6bb4d1bead5388/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:f3e98bb3798ead92273dc0e5fd0f31ade220f59a266ffd8a4f6065e0a3ce0523", size = 22733, upload-time = "2025-09-27T18:37:24.237Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/14/c7/ca723101509b518797fedc2fdf79ba57f886b4aca8a7d31857ba3ee8281f/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5678211cb9333a6468fb8d8be0305520aa073f50d17f089b5b4b477ea6e67fdc", size = 23672, upload-time = "2025-09-27T18:37:25.271Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fb/df/5bd7a48c256faecd1d36edc13133e51397e41b73bb77e1a69deab746ebac/markupsafe-3.0.3-cp314-cp314t-win32.whl", hash = "sha256:915c04ba3851909ce68ccc2b8e2cd691618c4dc4c4232fb7982bca3f41fd8c3d", size = 14819, upload-time = "2025-09-27T18:37:26.285Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1a/8a/0402ba61a2f16038b48b39bccca271134be00c5c9f0f623208399333c448/markupsafe-3.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4faffd047e07c38848ce017e8725090413cd80cbc23d86e55c587bf979e579c9", size = 15426, upload-time = "2025-09-27T18:37:27.316Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/70/bc/6f1c2f612465f5fa89b95bead1f44dcb607670fd42891d8fdcd5d039f4f4/markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa", size = 14146, upload-time = "2025-09-27T18:37:28.327Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mypy-extensions"
|
||||
version = "1.1.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload-time = "2025-04-22T14:54:24.164Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "packaging"
|
||||
version = "26.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d7/f1/e7a6dd94a8d4a5626c03e4e99c87f241ba9e350cd9e6d75123f992427270/packaging-26.2.tar.gz", hash = "sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661", size = 228134, upload-time = "2026-04-24T20:15:23.917Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/df/b2/87e62e8c3e2f4b32e5fe99e0b86d576da1312593b39f47d8ceef365e95ed/packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e", size = 100195, upload-time = "2026-04-24T20:15:22.081Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pathspec"
|
||||
version = "1.1.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/5a/82/42f767fc1c1143d6fd36efb827202a2d997a375e160a71eb2888a925aac1/pathspec-1.1.1.tar.gz", hash = "sha256:17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a", size = 135180, upload-time = "2026-04-27T01:46:08.907Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/f1/d9/7fb5aa316bc299258e68c73ba3bddbc499654a07f151cba08f6153988714/pathspec-1.1.1-py3-none-any.whl", hash = "sha256:a00ce642f577bf7f473932318056212bc4f8bfdf53128c78bbd5af0b9b20b189", size = 57328, upload-time = "2026-04-27T01:46:07.06Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "piccolo"
|
||||
version = "1.34.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "black" },
|
||||
{ name = "colorama" },
|
||||
{ name = "inflection" },
|
||||
{ name = "jinja2" },
|
||||
{ name = "pydantic", extra = ["email"] },
|
||||
{ name = "targ" },
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b3/d1/7b5a5a3969e3d5971c8df14318fe949030b268f2d3566cb06808066d92d1/piccolo-1.34.0.tar.gz", hash = "sha256:72e27ff89fd26f78c03888d8b30b82d8707f409464fbc356e02447b5dc0145d8", size = 295369, upload-time = "2026-05-11T23:02:16.494Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/ac/f9/29302268e82d96d4ca35c725e82dcb14d24ffce86c0f10a187edde532640/piccolo-1.34.0-py3-none-any.whl", hash = "sha256:fff1aeb79b8e24d43c27b3586e5b7dd90712d0a55555771e65812f2c8e6fd1f5", size = 417895, upload-time = "2026-05-11T23:02:14.653Z" },
|
||||
]
|
||||
|
||||
[package.optional-dependencies]
|
||||
postgres = [
|
||||
{ name = "asyncpg" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "platformdirs"
|
||||
version = "4.10.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d7/47/e4501f49c178ae1d9f4a75073fda4204f52647993f075a9db4d14930e0c5/platformdirs-4.10.0.tar.gz", hash = "sha256:31e761a6a0ca04faf7353ea759bdba55652be214725111e5aac52dfa29d4bef7", size = 31224, upload-time = "2026-05-28T03:32:53.587Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/81/e6/cd9575ac904136b3cbf7aa7ee819ef86eedb7274e46f230e94ea4342e729/platformdirs-4.10.0-py3-none-any.whl", hash = "sha256:fb516cdb12eb0d857d0cd85a7c57cea4d060bee4578d6cf5a14dfdf8cbf8784a", size = 22743, upload-time = "2026-05-28T03:32:52.175Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pydantic"
|
||||
version = "2.13.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "annotated-types" },
|
||||
{ name = "pydantic-core" },
|
||||
{ name = "typing-extensions" },
|
||||
{ name = "typing-inspection" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/18/a5/b60d21ac674192f8ab0ba4e9fd860690f9b4a6e51ca5df118733b487d8d6/pydantic-2.13.4.tar.gz", hash = "sha256:c40756b57adaa8b1efeeced5c196f3f3b7c435f90e84ea7f443901bec8099ef6", size = 844775, upload-time = "2026-05-06T13:43:05.343Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/fd/7b/122376b1fd3c62c1ed9dc80c931ace4844b3c55407b6fb2d199377c9736f/pydantic-2.13.4-py3-none-any.whl", hash = "sha256:45a282cde31d808236fd7ea9d919b128653c8b38b393d1c4ab335c62924d9aba", size = 472262, upload-time = "2026-05-06T13:43:02.641Z" },
|
||||
]
|
||||
|
||||
[package.optional-dependencies]
|
||||
email = [
|
||||
{ name = "email-validator" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pydantic-core"
|
||||
version = "2.46.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/9d/56/921726b776ace8d8f5db44c4ef961006580d91dc52b803c489fafd1aa249/pydantic_core-2.46.4.tar.gz", hash = "sha256:62f875393d7f270851f20523dd2e29f082bcc82292d66db2b64ea71f64b6e1c1", size = 471464, upload-time = "2026-05-06T13:37:06.98Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/51/a2/5d30b469c5267a17b39dec53208222f76a8d351dfac4af661888c5aee77d/pydantic_core-2.46.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:5d5902252db0d3cedf8d4a1bc68f70eeb430f7e4c7104c8c476753519b423008", size = 2106306, upload-time = "2026-05-06T13:37:48.029Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c1/81/4fa520eaffa8bd7d1525e644cd6d39e7d60b1592bc5b516693c7340b50f1/pydantic_core-2.46.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:c94f0688e7b8d0a67abf40e57a7eaaecd17cc9586706a31b76c031f63df052b4", size = 1951906, upload-time = "2026-05-06T13:37:17.012Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/03/d5/fd02da45b659668b05923b17ba3a0100a0a3d5541e3bd8fcc4ecb711309e/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f027324c56cd5406ca49c124b0db10e56c69064fec039acc571c29020cc87c76", size = 1976802, upload-time = "2026-05-06T13:37:35.113Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/21/f2/95727e1368be3d3ed485eaab7adbd7dda408f33f7a36e8b48e0144002b91/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e739fee756ba1010f8bcccb534252e85a35fe45ae92c295a06059ce58b74ccd3", size = 2052446, upload-time = "2026-05-06T13:37:12.313Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9c/86/5d99feea3f77c7234b8718075b23db11532773c1a0dbd9b9490215dc2eeb/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9d56801be94b86a9da183e5f3766e6310752b99ff647e38b09a9500d88e46e76", size = 2232757, upload-time = "2026-05-06T13:39:01.149Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d2/3a/508ac615935ef7588cf6d9e9b91309fdc2da751af865e02a9098de88258c/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2412e734dcb48da14d4e4006b82b46b74f2518b8a26ee7e58c6844a6cd6d03c4", size = 2309275, upload-time = "2026-05-06T13:37:41.406Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/07/f8/41db9de19d7987d6b04715a02b3b40aea467000275d9d758ffaa31af7d50/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9551187363ffc0de2a00b2e47c25aeaeb1020b69b668762966df15fc5659dd5a", size = 2094467, upload-time = "2026-05-06T13:39:18.847Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2c/e2/f35033184cb11d0052daf4416e8e10a502ea2ac006fc4f459aee872727d1/pydantic_core-2.46.4-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:0186750b482eefa11d7f435892b09c5c606193ef3375bcf94aa00ae6bfb66262", size = 2134417, upload-time = "2026-05-06T13:40:17.944Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7e/7b/6ceeb1cc90e193862f444ebe373d8fdf613f0a82572dde03fb10734c6c71/pydantic_core-2.46.4-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5855698a4856556d86e8e6cd8434bc3ac0314ee8e12089ae0e143f64c6256e4e", size = 2179782, upload-time = "2026-05-06T13:40:32.618Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5a/f2/c8d7773ede6af08036423a00ae0ceffce266c3c52a096c435d68c896083f/pydantic_core-2.46.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:cbaf13819775b7f769bf4a1f066cb6df7a28d4480081a589828ef190226881cd", size = 2188782, upload-time = "2026-05-06T13:36:51.018Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/59/31/0c864784e31f09f05cdd87606f08923b9c9e7f6e51dd27f20f62f975ce9f/pydantic_core-2.46.4-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:633147d34cf4550417f12e2b1a0383973bdf5cdfde212cb09e9a581cf10820be", size = 2328334, upload-time = "2026-05-06T13:40:37.764Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c2/eb/4f6c8a41efa30baa755590f4141abf3a8c370fab610915733e74134a7270/pydantic_core-2.46.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:82cf5301172168103724d49a1444d3378cb20cdee30b116a1bd6031236298a5d", size = 2372986, upload-time = "2026-05-06T13:39:34.152Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5b/24/b375a480d53113860c299764bfe9f349a3dc9108b3adc0d7f0d786492ebf/pydantic_core-2.46.4-cp313-cp313-win32.whl", hash = "sha256:9fa8ae11da9e2b3126c6426f147e0fba88d96d65921799bb30c6abd1cb2c97fb", size = 1973693, upload-time = "2026-05-06T13:37:55.072Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7e/e8/cff247591966f2d22ec8c003cd7587e27b7ba7b81ab2fb888e3ab75dc285/pydantic_core-2.46.4-cp313-cp313-win_amd64.whl", hash = "sha256:6b3ace8194b0e5204818c92802dcdca7fc6d88aabbb799d7c795540d9cd6d292", size = 2071819, upload-time = "2026-05-06T13:38:49.139Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c6/1a/f4aee670d5670e9e148e0c82c7db98d780be566c6e6a97ee8035528ca0b3/pydantic_core-2.46.4-cp313-cp313-win_arm64.whl", hash = "sha256:184c081504d17f1c1066e430e117142b2c77d9448a97f7b65c6ac9fd9aee238d", size = 2027411, upload-time = "2026-05-06T13:40:45.796Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8d/74/228a26ddad29c6672b805d9fd78e8d251cd04004fa7eed0e622096cd0250/pydantic_core-2.46.4-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:428e04521a40150c85216fc8b85e8d39fece235a9cf5e383761238c7fa9b96fb", size = 2102079, upload-time = "2026-05-06T13:38:41.019Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ad/1f/8970b150a4b4365623ae00fc88603491f763c627311ae8031e3111356d6e/pydantic_core-2.46.4-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:23ace664830ee0bfe014a0c7bc248b1f7f25ed7ad103852c317624a1083af462", size = 1952179, upload-time = "2026-05-06T13:36:59.812Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/95/30/5211a831ae054928054b2f79731661087a2bc5c01e825c672b3a4a8f1b3e/pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce5c1d2a8b27468f433ca974829c44060b8097eedc39933e3c206a90ee49c4a9", size = 1978926, upload-time = "2026-05-06T13:37:39.933Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/57/e9/689668733b1eb67adeef047db3c2e8788fcf65a7fd9c9e2b46b7744fe245/pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7283d57845ecf5a163403eb0702dfc220cc4fbdd18919cb5ccea4f95ee1cdab4", size = 2046785, upload-time = "2026-05-06T13:38:01.995Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/60/d9/6715260422ff50a2109878fd24d948a6c3446bb2664f34ee78cd972b3acd/pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8daafc69c93ee8a0204506a3b6b30f586ef54028f52aeeeb5c4cfc5184fd5914", size = 2228733, upload-time = "2026-05-06T13:40:50.371Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/18/ae/fdb2f64316afca925640f8e70bb1a564b0ec2721c1389e25b8eb4bf9a299/pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd2213145bcc2ba85884d0ac63d222fece9209678f77b9b4d76f054c561adb28", size = 2307534, upload-time = "2026-05-06T13:37:21.531Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/89/1d/8eff589b45bb8190a9d12c49cfad0f176a5cbd1534908a6b5125e2886239/pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7a5f930472650a82629163023e630d160863fce524c616f4e5186e5de9d9a49b", size = 2099732, upload-time = "2026-05-06T13:39:31.942Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/06/d5/ee5a3366637fee41dee51a1fc91562dcf12ddbc68fda34e6b253da2324bb/pydantic_core-2.46.4-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:c1b3f518abeca3aa13c712fd202306e145abf59a18b094a6bafb2d2bbf59192c", size = 2129627, upload-time = "2026-05-06T13:37:25.033Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/94/33/2414be571d2c6a6c4d08be21f9292b6d3fdb08949a97b6dfe985017821db/pydantic_core-2.46.4-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1a7dd0b3ee80d90150e3495a3a13ac34dbcbfd4f012996a6a1d8900e91b5c0fb", size = 2179141, upload-time = "2026-05-06T13:37:14.046Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7b/79/7daa95be995be0eecc4cf75064cb33f9bbbfe3fe0158caf2f0d4a996a5c7/pydantic_core-2.46.4-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:3fb702cd90b0446a3a1c5e470bfa0dd23c0233b676a9099ddcc964fa6ca13898", size = 2184325, upload-time = "2026-05-06T13:36:53.615Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9f/cb/d0a382f5c0de8a222dc61c65348e0ce831b1f68e0a018450d31c2cace3a5/pydantic_core-2.46.4-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:b8458003118a712e66286df6a707db01c52c0f52f7db8e4a38f0da1d3b94fc4e", size = 2323990, upload-time = "2026-05-06T13:40:29.971Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/05/db/d9ba624cc4a5aced1598e88c04fdbd8310c8a69b9d38b9a3d39ce3a61ed7/pydantic_core-2.46.4-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:372429a130e469c9cd698925ce5fc50940b7a1336b0d82038e63d5bbc4edc519", size = 2369978, upload-time = "2026-05-06T13:37:23.027Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f2/20/d15df15ba918c423461905802bfd2981c3af0bfa0e40d05e13edbfa48bc3/pydantic_core-2.46.4-cp314-cp314-win32.whl", hash = "sha256:85bb3611ff1802f3ee7fdd7dbff26b56f343fb432d57a4728fdd49b6ef35e2f4", size = 1966354, upload-time = "2026-05-06T13:38:03.499Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fc/b6/6b8de4c0a7d7ab3004c439c80c5c1e0a3e8d78bbae19379b01960383d9e5/pydantic_core-2.46.4-cp314-cp314-win_amd64.whl", hash = "sha256:811ff8e9c313ab425368bcbb36e5c4ebd7108c2bbf4e4089cfbb0b01eff63fac", size = 2072238, upload-time = "2026-05-06T13:39:40.807Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/32/36/51eb763beec1f4cf59b1db243a7dcc39cbb41230f050a09b9d69faaf0a48/pydantic_core-2.46.4-cp314-cp314-win_arm64.whl", hash = "sha256:bfec22eab3c8cc2ceec0248aec886624116dc079afa027ecc8ad4a7e62010f8a", size = 2018251, upload-time = "2026-05-06T13:37:26.72Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e8/91/855af51d625b23aa987116a19e231d2aaef9c4a415273ddc189b79a45fee/pydantic_core-2.46.4-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:af8244b2bef6aaad6d92cda81372de7f8c8d36c9f0c3ea36e827c60e7d9467a0", size = 2099593, upload-time = "2026-05-06T13:39:47.682Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fb/1b/8784a54c65edb5f49f0a14d6977cf1b209bba85a4c77445b255c2de58ab3/pydantic_core-2.46.4-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:5a4330cdbc57162e4b3aa303f588ba752257694c9c9be3e7ebb11b4aca659b5d", size = 1935226, upload-time = "2026-05-06T13:40:40.428Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e8/e7/1955d28d1afc56dd4b3ad7cc0cf39df1b9852964cf16e5d13912756d6d6b/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:29c61fc04a3d840155ff08e475a04809278972fe6aef51e2720554e96367e34b", size = 1974605, upload-time = "2026-05-06T13:37:32.029Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/93/e2/3fedbf0ba7a22850e6e9fd78117f1c0f10f950182344d8a6c535d468fdd8/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c50f2528cf200c5eed56faf3f4e22fcd5f38c157a8b78576e6ba3168ec35f000", size = 2030777, upload-time = "2026-05-06T13:38:55.239Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f8/61/46be275fcaaba0b4f5b9669dd852267ce1ff616592dccf7a7845588df091/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0cbe8b01f948de4286c74cdd6c667aceb38f5c1e26f0693b3983d9d74887c65e", size = 2236641, upload-time = "2026-05-06T13:37:08.096Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/60/db/12e93e46a8bac9988be3c016860f83293daea8c716c029c9ace279036f2f/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:617d7e2ca7dcb8c5cf6bcb8c59b8832c94b36196bbf1cbd1bfb56ed341905edd", size = 2286404, upload-time = "2026-05-06T13:40:20.221Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e2/4a/4d8b19008f38d31c53b8219cfedc2e3d5de5fe99d90076b7e767de29274f/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7027560ee92211647d0d34e3f7cd6f50da56399d26a9c8ad0da286d3869a53f3", size = 2109219, upload-time = "2026-05-06T13:38:12.153Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/88/70/3cbc40978fefb7bb09c6708d40d4ad1a5d70fd7213c3d17f971de868ec1f/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:f99626688942fb746e545232e7726926f3be91b5975f8b55327665fafda991c7", size = 2110594, upload-time = "2026-05-06T13:40:02.971Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9d/20/b8d36736216e29491125531685b2f9e61aa5b4b2599893f8268551da3338/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fc3e9034a63de20e15e8ade85358bc6efc614008cab72898b4b4952bea0509ff", size = 2159542, upload-time = "2026-05-06T13:39:27.506Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1d/a2/367df868eb584dacf6bf82a389272406d7178e301c4ac82545ab98bc2dd9/pydantic_core-2.46.4-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:97e7cf2be5c77b7d1a9713a05605d49460d02c6078d38d8bef3cbe323c548424", size = 2168146, upload-time = "2026-05-06T13:38:31.93Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c1/b8/4460f77f7e201893f649a29ab355dddd3beee8a97bcb1a320db414f9a06e/pydantic_core-2.46.4-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:3bf92c5d0e00fefaab325a4d27828fe6b6e2a21848686b5b60d2d9eeb09d76c6", size = 2306309, upload-time = "2026-05-06T13:37:44.717Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/64/c4/be2639293acd87dc8ddbcec41a73cee9b2ebf996fe6d892a1a74e88ad3f7/pydantic_core-2.46.4-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:3ecbc122d18468d06ca279dc26a8c2e2d5acb10943bb35e36ae92096dc3b5565", size = 2369736, upload-time = "2026-05-06T13:37:05.645Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/30/a6/9f9f380dbb301f67023bf8f707aaa75daadf84f7152d95c410fd7e81d994/pydantic_core-2.46.4-cp314-cp314t-win32.whl", hash = "sha256:e846ae7835bf0703ae43f534ab79a867146dadd59dc9ca5c8b53d5c8f7c9ef02", size = 1955575, upload-time = "2026-05-06T13:38:51.116Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/40/1f/f1eb9eb350e795d1af8586289746f5c5677d16043040d63710e22abc43c9/pydantic_core-2.46.4-cp314-cp314t-win_amd64.whl", hash = "sha256:2108ba5c1c1eca18030634489dc544844144ee36357f2f9f780b93e7ddbb44b5", size = 2051624, upload-time = "2026-05-06T13:38:21.672Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f6/d2/42dd53d0a85c27606f316d3aa5d2869c4e8470a5ed6dec30e4a1abe19192/pydantic_core-2.46.4-cp314-cp314t-win_arm64.whl", hash = "sha256:4fcbe087dbc2068af7eda3aa87634eba216dbda64d1ae73c8684b621d33f6596", size = 2017325, upload-time = "2026-05-06T13:40:52.723Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pytokens"
|
||||
version = "0.4.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b6/34/b4e015b99031667a7b960f888889c5bd34ef585c85e1cb56a594b92836ac/pytokens-0.4.1.tar.gz", hash = "sha256:292052fe80923aae2260c073f822ceba21f3872ced9a68bb7953b348e561179a", size = 23015, upload-time = "2026-01-30T01:03:45.924Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/cb/dc/08b1a080372afda3cceb4f3c0a7ba2bde9d6a5241f1edb02a22a019ee147/pytokens-0.4.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:8bdb9d0ce90cbf99c525e75a2fa415144fd570a1ba987380190e8b786bc6ef9b", size = 160720, upload-time = "2026-01-30T01:03:13.843Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/64/0c/41ea22205da480837a700e395507e6a24425151dfb7ead73343d6e2d7ffe/pytokens-0.4.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5502408cab1cb18e128570f8d598981c68a50d0cbd7c61312a90507cd3a1276f", size = 254204, upload-time = "2026-01-30T01:03:14.886Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e0/d2/afe5c7f8607018beb99971489dbb846508f1b8f351fcefc225fcf4b2adc0/pytokens-0.4.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:29d1d8fb1030af4d231789959f21821ab6325e463f0503a61d204343c9b355d1", size = 268423, upload-time = "2026-01-30T01:03:15.936Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/68/d4/00ffdbd370410c04e9591da9220a68dc1693ef7499173eb3e30d06e05ed1/pytokens-0.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:970b08dd6b86058b6dc07efe9e98414f5102974716232d10f32ff39701e841c4", size = 266859, upload-time = "2026-01-30T01:03:17.458Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a7/c9/c3161313b4ca0c601eeefabd3d3b576edaa9afdefd32da97210700e47652/pytokens-0.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:9bd7d7f544d362576be74f9d5901a22f317efc20046efe2034dced238cbbfe78", size = 103520, upload-time = "2026-01-30T01:03:18.652Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8f/a7/b470f672e6fc5fee0a01d9e75005a0e617e162381974213a945fcd274843/pytokens-0.4.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4a14d5f5fc78ce85e426aa159489e2d5961acf0e47575e08f35584009178e321", size = 160821, upload-time = "2026-01-30T01:03:19.684Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/80/98/e83a36fe8d170c911f864bfded690d2542bfcfacb9c649d11a9e6eb9dc41/pytokens-0.4.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:97f50fd18543be72da51dd505e2ed20d2228c74e0464e4262e4899797803d7fa", size = 254263, upload-time = "2026-01-30T01:03:20.834Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0f/95/70d7041273890f9f97a24234c00b746e8da86df462620194cef1d411ddeb/pytokens-0.4.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dc74c035f9bfca0255c1af77ddd2d6ae8419012805453e4b0e7513e17904545d", size = 268071, upload-time = "2026-01-30T01:03:21.888Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/da/79/76e6d09ae19c99404656d7db9c35dfd20f2086f3eb6ecb496b5b31163bad/pytokens-0.4.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:f66a6bbe741bd431f6d741e617e0f39ec7257ca1f89089593479347cc4d13324", size = 271716, upload-time = "2026-01-30T01:03:23.633Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/79/37/482e55fa1602e0a7ff012661d8c946bafdc05e480ea5a32f4f7e336d4aa9/pytokens-0.4.1-cp314-cp314-win_amd64.whl", hash = "sha256:b35d7e5ad269804f6697727702da3c517bb8a5228afa450ab0fa787732055fc9", size = 104539, upload-time = "2026-01-30T01:03:24.788Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/30/e8/20e7db907c23f3d63b0be3b8a4fd1927f6da2395f5bcc7f72242bb963dfe/pytokens-0.4.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:8fcb9ba3709ff77e77f1c7022ff11d13553f3c30299a9fe246a166903e9091eb", size = 168474, upload-time = "2026-01-30T01:03:26.428Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d6/81/88a95ee9fafdd8f5f3452107748fd04c24930d500b9aba9738f3ade642cc/pytokens-0.4.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:79fc6b8699564e1f9b521582c35435f1bd32dd06822322ec44afdeba666d8cb3", size = 290473, upload-time = "2026-01-30T01:03:27.415Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/cf/35/3aa899645e29b6375b4aed9f8d21df219e7c958c4c186b465e42ee0a06bf/pytokens-0.4.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d31b97b3de0f61571a124a00ffe9a81fb9939146c122c11060725bd5aea79975", size = 303485, upload-time = "2026-01-30T01:03:28.558Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/52/a0/07907b6ff512674d9b201859f7d212298c44933633c946703a20c25e9d81/pytokens-0.4.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:967cf6e3fd4adf7de8fc73cd3043754ae79c36475c1c11d514fc72cf5490094a", size = 306698, upload-time = "2026-01-30T01:03:29.653Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/39/2a/cbbf9250020a4a8dd53ba83a46c097b69e5eb49dd14e708f496f548c6612/pytokens-0.4.1-cp314-cp314t-win_amd64.whl", hash = "sha256:584c80c24b078eec1e227079d56dc22ff755e0ba8654d8383b2c549107528918", size = 116287, upload-time = "2026-01-30T01:03:30.912Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c6/78/397db326746f0a342855b81216ae1f0a32965deccfd7c830a2dbc66d2483/pytokens-0.4.1-py3-none-any.whl", hash = "sha256:26cef14744a8385f35d0e095dc8b3a7583f6c953c2e3d269c7f82484bf5ad2de", size = 13729, upload-time = "2026-01-30T01:03:45.029Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "targ"
|
||||
version = "0.6.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "colorama" },
|
||||
{ name = "docstring-parser" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/86/6d/93cd8b2233c4040e2922ff77377ed33817f0370d603e0cc5c9a9c391adda/targ-0.6.0.tar.gz", hash = "sha256:4025476f1528eef963900295c2979b38ba28aadbd3668df9ae6677237b62a1d5", size = 9891, upload-time = "2025-07-09T22:04:01.224Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/54/90/434ca23854e9d358f8562b51e688760bcc59a1d4be46a91aa37fd0f37d24/targ-0.6.0-py3-none-any.whl", hash = "sha256:75b83a49181d4758c2ef0caf345c8ced78156dee66613bab0a1a614e8e0ec7b6", size = 7308, upload-time = "2025-07-09T22:04:00.373Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typing-extensions"
|
||||
version = "4.15.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typing-inspection"
|
||||
version = "0.4.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/55/e3/70399cb7dd41c10ac53367ae42139cf4b1ca5f36bb3dc6c9d33acdb43655/typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464", size = 75949, upload-time = "2025-10-01T02:14:41.687Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/dc/9b/47798a6c91d8bdb567fe2698fe81e0c6b7cb7ef4d13da4114b41d239f65d/typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7", size = 14611, upload-time = "2025-10-01T02:14:40.154Z" },
|
||||
]
|
||||
@@ -1,6 +1,11 @@
|
||||
/*
|
||||
* This file was generated by the Gradle 'init' task.
|
||||
*
|
||||
* This is a general purpose Gradle build.
|
||||
* Learn more about Gradle by exploring our Samples at https://docs.gradle.org/9.4.1/samples
|
||||
*/
|
||||
plugins {
|
||||
id("base")
|
||||
id("maven-publish")
|
||||
id("de.infolektuell.typst") version "0.8.0"
|
||||
}
|
||||
|
||||
@@ -11,39 +16,6 @@ typst.sourceSets {
|
||||
val main by registering {
|
||||
// The files to compile (without .typ extension) in src/main/typst
|
||||
documents = listOf("kontor") // src/main/typst/document.typst
|
||||
inputs.put("version", version.toString())
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<AbstractPublishToMaven>().configureEach {
|
||||
dependsOn(tasks.named("compileTypst"))
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("maven") {
|
||||
artifactId = "kontor"
|
||||
artifact(file("build/typst/main/pdf/kontor.pdf")) {
|
||||
classifier = "docs"
|
||||
extension = "pdf"
|
||||
}
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
// Determine URL based on version
|
||||
url = uri(
|
||||
if (version.toString().endsWith("SNAPSHOT")) {
|
||||
"https://nexus.thpeetz.de/repository/maven-snapshots/"
|
||||
} else {
|
||||
"https://nexus.thpeetz.de/repository/maven-releases/"
|
||||
}
|
||||
)
|
||||
// Credentials
|
||||
credentials {
|
||||
username = project.findProperty("nexusUsername") as String? ?: System.getenv("NEXUS_USERNAME")
|
||||
password = project.findProperty("nexusPassword") as String? ?: System.getenv("NEXUS_PASSWORD")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# This file was generated by the Gradle 'init' task.
|
||||
# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties
|
||||
description='Kontor Documentation'
|
||||
version=0.4.0-SNAPSHOT
|
||||
group=de.thpeetz
|
||||
|
||||
org.gradle.configuration-cache=true
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#let version = sys.inputs.at("version", default: "0.0.1")
|
||||
//#set page("a4")
|
||||
#import "@preview/basic-report:0.5.0": *
|
||||
#import "@preview/basic-report:0.4.0": *
|
||||
#import "@preview/in-dexter:0.7.2": *
|
||||
#import "@preview/pintorita:0.1.4"
|
||||
|
||||
@@ -9,12 +8,14 @@
|
||||
|
||||
#show: it => basic-report(
|
||||
doc-category: "Entwicklungs- und Projekthandbuch",
|
||||
doc-title: "Projekt kontor\nVersion " + version,
|
||||
doc-title: "Projekt kontor",
|
||||
author: "Thomas Peetz",
|
||||
//affiliation: "MouseTec, Entenhausen",
|
||||
//logo: image("assets/aerospace-engineering.png", width: 2cm),
|
||||
// <a href="https://www.flaticon.com/free-icons/aerospace" title="aerospace icons">Aerospace icons created by gravisio - Flaticon</a>
|
||||
language: "de",
|
||||
compact-mode: false,
|
||||
show-outline: true,
|
||||
it,
|
||||
it
|
||||
)
|
||||
|
||||
= Allgemeines
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# script/cibuild:
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
source version
|
||||
|
||||
echo " => Baue Image localhost/kontor-echo:$kontorVersion"
|
||||
buildah build -t kontor-echo:$kontorVersion kontor-echo
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"kontor-api-echo/internal/config"
|
||||
"kontor-api-echo/internal/handlers"
|
||||
"kontor-api-echo/internal/router"
|
||||
"kontor-api-echo/pkg/schema"
|
||||
"log"
|
||||
"log/slog"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/labstack/echo/v5"
|
||||
)
|
||||
|
||||
func main() {
|
||||
slog.Info("Kontor started")
|
||||
|
||||
db, _ := schema.GetDatabase()
|
||||
|
||||
if err := config.InitConfig(); err != nil {
|
||||
log.Fatalf("Failed to initialize config: %v", err)
|
||||
}
|
||||
e := router.New(handlers.NewAdminHandler(db), handlers.NewMediaHandler(db))
|
||||
|
||||
// Cancel the context on SIGINT / SIGTERM
|
||||
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
||||
defer stop()
|
||||
|
||||
sc := echo.StartConfig{
|
||||
Address: ":1323",
|
||||
GracefulTimeout: 10 * time.Second,
|
||||
}
|
||||
if err := sc.Start(ctx, e); err != nil {
|
||||
e.Logger.Error("server stopped", "error", err)
|
||||
}
|
||||
|
||||
slog.Info("Kontor finished")
|
||||
}
|
||||
+17
-46
@@ -1,68 +1,39 @@
|
||||
module kontor-api-echo
|
||||
|
||||
go 1.26.0
|
||||
|
||||
require (
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/labstack/echo-jwt/v4 v4.4.0
|
||||
github.com/labstack/echo-jwt/v5 v5.0.2
|
||||
github.com/labstack/echo/v4 v4.15.0
|
||||
github.com/labstack/echo/v5 v5.4.4
|
||||
github.com/stretchr/testify v1.11.1
|
||||
github.com/uptrace/bun v1.3.0
|
||||
github.com/uptrace/bun/dialect/pgdialect v1.2.16
|
||||
github.com/uptrace/bun/driver/pgdriver v1.2.16
|
||||
golang.org/x/crypto v0.54.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/mattn/go-sqlite3 v1.14.34 // indirect
|
||||
github.com/ncruces/go-strftime v1.0.0 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa // indirect
|
||||
modernc.org/libc v1.68.0 // indirect
|
||||
modernc.org/mathutil v1.7.1 // indirect
|
||||
modernc.org/memory v1.11.0 // indirect
|
||||
modernc.org/sqlite v1.46.1 // indirect
|
||||
)
|
||||
go 1.24.2
|
||||
|
||||
require (
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/fsnotify/fsnotify v1.10.1 // indirect
|
||||
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/fatih/color v1.18.0 // indirect
|
||||
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/joho/godotenv v1.5.1 // indirect
|
||||
github.com/labstack/echo-jwt/v4 v4.4.0 // indirect
|
||||
github.com/labstack/echo/v4 v4.15.0 // indirect
|
||||
github.com/labstack/gommon v0.4.2 // indirect
|
||||
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.4.3 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/puzpuzpuz/xsync/v3 v3.5.1 // indirect
|
||||
github.com/sagikazarmark/locafero v0.12.0 // indirect
|
||||
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
|
||||
github.com/spf13/afero v1.15.0 // indirect
|
||||
github.com/spf13/cast v1.10.0 // indirect
|
||||
github.com/spf13/cobra v1.10.2 // indirect
|
||||
github.com/spf13/pflag v1.1.0 // indirect
|
||||
github.com/spf13/viper v1.21.0 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/stretchr/testify v1.11.1 // indirect
|
||||
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect
|
||||
github.com/uptrace/bun/dialect/sqlitedialect v1.3.0
|
||||
github.com/uptrace/bun/driver/sqliteshim v1.3.0
|
||||
github.com/uptrace/bun v1.2.16 // indirect
|
||||
github.com/uptrace/bun/dialect/pgdialect v1.2.16 // indirect
|
||||
github.com/uptrace/bun/driver/pgdriver v1.2.16 // indirect
|
||||
github.com/uptrace/bun/extra/bundebug v1.2.16 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/valyala/fasttemplate v1.2.2 // indirect
|
||||
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
|
||||
go.opentelemetry.io/otel v1.39.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.39.0 // indirect
|
||||
go.yaml.in/yaml/v3 v3.0.6 // indirect
|
||||
golang.org/x/net v0.57.0 // indirect
|
||||
golang.org/x/sys v0.49.0 // indirect
|
||||
golang.org/x/text v0.43.0 // indirect
|
||||
golang.org/x/time v0.16.0 // indirect
|
||||
golang.org/x/crypto v0.46.0 // indirect
|
||||
golang.org/x/net v0.48.0 // indirect
|
||||
golang.org/x/sys v0.39.0 // indirect
|
||||
golang.org/x/text v0.32.0 // indirect
|
||||
golang.org/x/time v0.14.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
mellium.im/sasl v0.3.2 // indirect
|
||||
)
|
||||
|
||||
+18
-82
@@ -1,88 +1,43 @@
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
|
||||
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
||||
github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx59Ho=
|
||||
github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo=
|
||||
github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro=
|
||||
github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY=
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
|
||||
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
|
||||
github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
|
||||
github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
|
||||
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
|
||||
github.com/labstack/echo-jwt/v4 v4.4.0 h1:nrXaEnJupfc2R4XChcLRDyghhMZup77F8nIzHnBK19U=
|
||||
github.com/labstack/echo-jwt/v4 v4.4.0/go.mod h1:kYXWgWms9iFqI3ldR+HAEj/Zfg5rZtR7ePOgktG4Hjg=
|
||||
github.com/labstack/echo-jwt/v5 v5.0.2 h1:ECmHEjwbR30fv90LvpQ0XZbEJWhCF/c3Zp8ug/iVrCE=
|
||||
github.com/labstack/echo-jwt/v5 v5.0.2/go.mod h1:jNxekWlI4+M+UoV8dozKwIHN9MJ2psUR+U1B0nEutIg=
|
||||
github.com/labstack/echo/v4 v4.15.0 h1:hoRTKWcnR5STXZFe9BmYun9AMTNeSbjHi2vtDuADJ24=
|
||||
github.com/labstack/echo/v4 v4.15.0/go.mod h1:xmw1clThob0BSVRX1CRQkGQ/vjwcpOMjQZSZa9fKA/c=
|
||||
github.com/labstack/echo/v5 v5.4.4 h1:Nag9Mee0M9sOcKjProYuDNiw60QisysgfbIgz5US5Cw=
|
||||
github.com/labstack/echo/v5 v5.4.4/go.mod h1:4iEGNQiPPZnkfYpNR/L6fINd3NLiGWUD5+eBotFALas=
|
||||
github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0=
|
||||
github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU=
|
||||
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
||||
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-sqlite3 v1.14.34 h1:3NtcvcUnFBPsuRcno8pUtupspG/GM+9nZ88zgJcp6Zk=
|
||||
github.com/mattn/go-sqlite3 v1.14.34/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
|
||||
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/pelletier/go-toml/v2 v2.4.3 h1:GTRvJQutkOSftxIFD5xw9aepkYNuPWmVJpffdDPYVpY=
|
||||
github.com/pelletier/go-toml/v2 v2.4.3/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/puzpuzpuz/xsync/v3 v3.5.1 h1:GJYJZwO6IdxN/IKbneznS6yPkVC+c3zyY/j19c++5Fg=
|
||||
github.com/puzpuzpuz/xsync/v3 v3.5.1/go.mod h1:VjzYrABPabuM4KyBh1Ftq6u8nhwY5tBPKP9jpmh0nnA=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/sagikazarmark/locafero v0.12.0 h1:/NQhBAkUb4+fH1jivKHWusDYFjMOOKU88eegjfxfHb4=
|
||||
github.com/sagikazarmark/locafero v0.12.0/go.mod h1:sZh36u/YSZ918v0Io+U9ogLYQJ9tLLBmM4eneO6WwsI=
|
||||
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=
|
||||
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=
|
||||
github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=
|
||||
github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=
|
||||
github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=
|
||||
github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
|
||||
github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
|
||||
github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=
|
||||
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/pflag v1.1.0 h1:6W6MbVUrnMb8PEhjkqwsVLY7ryuzRfFHF4mQd7L94ag=
|
||||
github.com/spf13/pflag v1.1.0/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=
|
||||
github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
|
||||
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
||||
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo=
|
||||
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs=
|
||||
github.com/uptrace/bun v1.2.16 h1:QlObi6ZIK5Ao7kAALnh91HWYNZUBbVwye52fmlQM9kc=
|
||||
github.com/uptrace/bun v1.2.16/go.mod h1:jMoNg2n56ckaawi/O/J92BHaECmrz6IRjuMWqlMaMTM=
|
||||
github.com/uptrace/bun v1.3.0 h1:hUcbfRpbQk4/upFSI+uZf6jSJw5A0lkIKt0XdpvbUZo=
|
||||
github.com/uptrace/bun v1.3.0/go.mod h1:wNltaKJk4JtOt4SG5I5zmA7v0/Mzjh1+/S906Rayd3Y=
|
||||
github.com/uptrace/bun/dialect/pgdialect v1.2.16 h1:KFNZ0LxAyczKNfK/IJWMyaleO6eI9/Z5tUv3DE1NVL4=
|
||||
github.com/uptrace/bun/dialect/pgdialect v1.2.16/go.mod h1:IJdMeV4sLfh0LDUZl7TIxLI0LipF1vwTK3hBC7p5qLo=
|
||||
github.com/uptrace/bun/dialect/sqlitedialect v1.3.0 h1:XzxkORYksxkLsIQLJHFYUb3yDvqSQHzTungyKpJhHTw=
|
||||
github.com/uptrace/bun/dialect/sqlitedialect v1.3.0/go.mod h1:x2D1sY50Itio0I/FVdNe30oMUT2ObiAS+oILcMR+Wys=
|
||||
github.com/uptrace/bun/driver/pgdriver v1.2.16 h1:b1kpXKUxtTSGYow5Vlsb+dKV3z0R7aSAJNfMfKp61ZU=
|
||||
github.com/uptrace/bun/driver/pgdriver v1.2.16/go.mod h1:H6lUZ9CBfp1X5Vq62YGSV7q96/v94ja9AYFjKvdoTk0=
|
||||
github.com/uptrace/bun/driver/sqliteshim v1.3.0 h1:T3ybxgmP8ejA99YULje9e12h+FqKKAP/4xZo3+X3mXA=
|
||||
github.com/uptrace/bun/driver/sqliteshim v1.3.0/go.mod h1:MqvqMCAAKNn6M0HF9YK/Z6xrnCP6sih5OZ37AxdAlHw=
|
||||
github.com/uptrace/bun/extra/bundebug v1.2.16 h1:3OXAfHTU4ydu2+4j05oB1BxPx6+ypdWIVzTugl/7zl0=
|
||||
github.com/uptrace/bun/extra/bundebug v1.2.16/go.mod h1:vk6R/1i67/S2RvUI5AH/m3P5e67mOkfDCmmCsAPUumo=
|
||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
|
||||
@@ -95,38 +50,19 @@ go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48=
|
||||
go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8=
|
||||
go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI=
|
||||
go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA=
|
||||
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
|
||||
go.yaml.in/yaml/v3 v3.0.6 h1:zcDfvjXEqTQmpjniUBLc91xYJMB2c4QOFxEF/LCEckM=
|
||||
go.yaml.in/yaml/v3 v3.0.6/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
|
||||
golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw=
|
||||
golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk=
|
||||
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa h1:Zt3DZoOFFYkKhDT3v7Lm9FDMEV06GpzjG2jrqW+QTE0=
|
||||
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa/go.mod h1:K79w1Vqn7PoiZn+TkNpx3BUWUQksGO3JcVX6qIjytmA=
|
||||
golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE=
|
||||
golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU=
|
||||
golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=
|
||||
golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=
|
||||
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
|
||||
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
|
||||
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
||||
golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA=
|
||||
golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
|
||||
golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs=
|
||||
golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY=
|
||||
golang.org/x/text v0.43.0 h1:1QivrlhwAsnMOcqgOdl9my7s9OyZl8O5/UGUTJVXoWc=
|
||||
golang.org/x/text v0.43.0/go.mod h1:hbSIYA/amXcRXTFSZqh8tWHEoqRvvbKPJ2uz/KU+a+s=
|
||||
golang.org/x/time v0.16.0 h1:vMb6ptszcQMkcwiRTAuNNU50gom6++Q/6gY2hDM6VDE=
|
||||
golang.org/x/time v0.16.0/go.mod h1:rVKOqvZeKvrDKTQiAHJ7wmwP0RzleSphoEA9RcdLA0s=
|
||||
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
|
||||
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
|
||||
golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
|
||||
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
|
||||
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
mellium.im/sasl v0.3.2 h1:PT6Xp7ccn9XaXAnJ03FcEjmAn7kK1x7aoXV6F+Vmrl0=
|
||||
mellium.im/sasl v0.3.2/go.mod h1:NKXDi1zkr+BlMHLQjY3ofYuU4KSPFxknb8mfEu6SveY=
|
||||
modernc.org/libc v1.68.0 h1:PJ5ikFOV5pwpW+VqCK1hKJuEWsonkIJhhIXyuF/91pQ=
|
||||
modernc.org/libc v1.68.0/go.mod h1:NnKCYeoYgsEqnY3PgvNgAeaJnso968ygU8Z0DxjoEc0=
|
||||
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
|
||||
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
|
||||
modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
|
||||
modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
|
||||
modernc.org/sqlite v1.46.1 h1:eFJ2ShBLIEnUWlLy12raN0Z1plqmFX9Qe3rjQTKt6sU=
|
||||
modernc.org/sqlite v1.46.1/go.mod h1:CzbrU2lSB1DKUusvwGz7rqEKIq+NUd8GWuBBZDs9/nA=
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
var (
|
||||
CfgFile string
|
||||
Verbose int
|
||||
Overwrite bool
|
||||
ServerName string
|
||||
Mediatype MediaType
|
||||
Config CliConfig
|
||||
ServerConfig ServerConfiguration
|
||||
DryRun bool
|
||||
FileName string
|
||||
)
|
||||
|
||||
const (
|
||||
mediaTypeMedia MediaType = "media"
|
||||
mediaTypeVideo MediaType = "video"
|
||||
mediaTypeLofi MediaType = "lofi"
|
||||
)
|
||||
|
||||
type MediaType string
|
||||
|
||||
func (e *MediaType) String() string {
|
||||
return string(*e)
|
||||
}
|
||||
|
||||
func (e *MediaType) Set(v string) error {
|
||||
switch v {
|
||||
case "media", "video", "lofi":
|
||||
*e = MediaType(v)
|
||||
return nil
|
||||
default:
|
||||
return errors.New(`must be one of "media", "video", "lofi"`)
|
||||
}
|
||||
}
|
||||
|
||||
func (e *MediaType) Type() string {
|
||||
return "MediaType"
|
||||
}
|
||||
|
||||
func myEnumCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||
return []string{
|
||||
"media\thelp text for media",
|
||||
"video\thelp text for video",
|
||||
"lofi\thelp text for lofi",
|
||||
}, cobra.ShellCompDirectiveDefault
|
||||
}
|
||||
|
||||
type Server struct {
|
||||
Url string `mapstructure:"url"`
|
||||
Username string `mapstructure:"username"`
|
||||
Password string `mapstructure:"password"`
|
||||
}
|
||||
|
||||
type Database struct {
|
||||
Type string `mapstructure:"type" validate:"required"`
|
||||
Path string `mapstructure:"path" validate:"required"`
|
||||
Host string `mapstructure:"host" validate:"required"`
|
||||
Name string `mapstructure:"name" validate:"required"`
|
||||
Port int `mapstructure:"port" validate:"required"`
|
||||
Password string `mapstructure:"password" validate:"required"`
|
||||
User string `mapstructure:"user" validate:"required"`
|
||||
}
|
||||
|
||||
type CliConfig struct {
|
||||
ApiVersion string
|
||||
Server map[string]Server `mapstructure:"server"`
|
||||
DB Database `mapstructure:"db"`
|
||||
}
|
||||
|
||||
type ServerConfiguration struct {
|
||||
Server struct {
|
||||
Port int `mapstructure:"port" validate:"required"`
|
||||
Host string `mapstructure:"host"`
|
||||
} `mapstructure:"server"`
|
||||
DB Database `mapstructure:"db"`
|
||||
Gin struct {
|
||||
Mode string `mapstructure:"mode" validate:"required"`
|
||||
} `mapstructure:"gin"`
|
||||
ApiSecret []byte `mapstructure:"api_secret"`
|
||||
}
|
||||
|
||||
func InitCliConfig() {
|
||||
slog.Info("InitCliConfig")
|
||||
if CfgFile != "" {
|
||||
viper.SetConfigFile(CfgFile)
|
||||
} else {
|
||||
viper.SetConfigName("kli") // without extension
|
||||
viper.SetConfigType("yaml")
|
||||
viper.AddConfigPath(".") // look for config in working directory
|
||||
viper.AddConfigPath("/home/tpeetz/.config")
|
||||
}
|
||||
Mediatype = mediaTypeMedia
|
||||
|
||||
// Read the configuration file
|
||||
if err := viper.ReadInConfig(); err != nil {
|
||||
// Handle the case where config file is not found
|
||||
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
|
||||
slog.Info("No config file found, using defaults")
|
||||
if err := viper.SafeWriteConfig(); err != nil {
|
||||
slog.Info("error writing config file", "error", err.Error())
|
||||
}
|
||||
} else {
|
||||
slog.Info("error reading config file", "error", err.Error())
|
||||
}
|
||||
} else {
|
||||
slog.Info("InitCliConfig", "Using config file: ", viper.ConfigFileUsed())
|
||||
if err := viper.Unmarshal(&Config); err != nil {
|
||||
slog.Info("parsing of config file failed", "error", err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func InitConfig() error {
|
||||
|
||||
viper.SetConfigName("kontor-gin")
|
||||
viper.SetConfigType("yaml")
|
||||
viper.AddConfigPath(".")
|
||||
viper.AddConfigPath("/home/tpeetz/.config")
|
||||
viper.AddConfigPath("/etc/kontor")
|
||||
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
|
||||
viper.AutomaticEnv()
|
||||
|
||||
viper.SetDefault("db.type", "postgres")
|
||||
viper.SetDefault("db.host", "localhost")
|
||||
viper.SetDefault("db.port", 5432)
|
||||
viper.SetDefault("db.name", "kontor")
|
||||
viper.SetDefault("db.user", "kontor")
|
||||
viper.SetDefault("db.password", "kontor")
|
||||
viper.SetDefault("db.path", "data/kontor.db")
|
||||
viper.SetDefault("server.port", 8550)
|
||||
viper.SetDefault("gin.mode", "release")
|
||||
// Read the config file
|
||||
if err := viper.ReadInConfig(); err != nil {
|
||||
// Handle the case where config file is not found
|
||||
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
|
||||
slog.Info("No config file found, using defaults")
|
||||
if err := viper.SafeWriteConfig(); err != nil {
|
||||
slog.Info("error writing config file", "error", err.Error())
|
||||
return fmt.Errorf("error writing config file: %w", err)
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("error reading config file: %w", err)
|
||||
}
|
||||
} else {
|
||||
slog.Info("InitConfig", "Using config file: ", viper.ConfigFileUsed())
|
||||
if err := viper.Unmarshal(&ServerConfig); err != nil {
|
||||
slog.Info("parsing of config file failed", "error", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
|
||||
"github.com/uptrace/bun"
|
||||
"github.com/uptrace/bun/dialect/pgdialect"
|
||||
"github.com/uptrace/bun/dialect/sqlitedialect"
|
||||
"github.com/uptrace/bun/driver/pgdriver"
|
||||
"github.com/uptrace/bun/driver/sqliteshim"
|
||||
)
|
||||
|
||||
func NewDB(db Database) (*bun.DB, error) {
|
||||
db_type := db.Type
|
||||
slog.Info("using database", "type", db_type)
|
||||
|
||||
switch db_type {
|
||||
case "postgres":
|
||||
dsn := fmt.Sprintf("postgres://%s:%s@%s:%d/%s", db.User, db.Password, db.Host, db.Port, db.Name)
|
||||
sqldb := sql.OpenDB(pgdriver.NewConnector(pgdriver.WithDSN(dsn)))
|
||||
db := bun.NewDB(sqldb, pgdialect.New())
|
||||
return db, nil
|
||||
case "sqlite":
|
||||
sqldb, _ := sql.Open(sqliteshim.ShimName, "file::memory:?cache=shared")
|
||||
db := bun.NewDB(sqldb, sqlitedialect.New())
|
||||
return db, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown db.type=%s", db_type)
|
||||
}
|
||||
// Configure GORM with custom settings
|
||||
// The logger helps with debugging SQL queries during development
|
||||
// if err != nil {
|
||||
// log.Fatal("Failed to connect to database:", err)
|
||||
// }
|
||||
|
||||
// // Get the underlying SQL database connection for pool configuration
|
||||
// sqlDB, err := db.DB()
|
||||
// if err != nil {
|
||||
// log.Fatal("Failed to get database instance:", err)
|
||||
// }
|
||||
|
||||
// // Configure connection pool settings
|
||||
// // MaxIdleConns: number of connections kept open when idle
|
||||
// sqlDB.SetMaxIdleConns(10)
|
||||
// // MaxOpenConns: maximum total connections to the database
|
||||
// sqlDB.SetMaxOpenConns(100)
|
||||
// // ConnMaxLifetime: how long a connection can be reused
|
||||
// sqlDB.SetConnMaxLifetime(time.Hour)
|
||||
|
||||
// slog.Info("Database connected successfully")
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package globals
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
var (
|
||||
Secret = []byte("secret")
|
||||
|
||||
Version = "unset"
|
||||
Commit = "unset"
|
||||
Date = "unset"
|
||||
)
|
||||
|
||||
const (
|
||||
UserKey = "user"
|
||||
MediaFileLink = "/media/files"
|
||||
MediaLofiLink = "/media/lofis"
|
||||
MediaMusicLink = "/media/musics"
|
||||
MediaVideoLink = "/media/videos"
|
||||
MediaArticleLink = "/media/articles"
|
||||
MediaActorLink = "/media/actors"
|
||||
)
|
||||
|
||||
func GetDefaultValues(user interface{}, message string) map[string]any {
|
||||
values := map[string]any{
|
||||
"title": "Kontor",
|
||||
"version": fmt.Sprintf("%s %s", Version, Commit),
|
||||
"message": message,
|
||||
"user": user,
|
||||
"media_file_link": MediaFileLink,
|
||||
"media_lofi_link": MediaLofiLink,
|
||||
"media_music_link": MediaMusicLink,
|
||||
"media_video_link": MediaVideoLink,
|
||||
"media_article_link": MediaArticleLink,
|
||||
"media_actor_link": MediaActorLink,
|
||||
}
|
||||
return values
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"github.com/uptrace/bun"
|
||||
)
|
||||
|
||||
type AdminHandler struct {
|
||||
AuthHandler *AuthHandler
|
||||
ProfileHandler *ProfileHandler
|
||||
PermissionHandler *PermissionHandler
|
||||
AssignmentHandler *AssignmentHandler
|
||||
TokenHandler *TokenHandler
|
||||
MailAccountHandler *MailAccountHandler
|
||||
MailHandler *MailHandler
|
||||
}
|
||||
|
||||
func NewAdminHandler(db *bun.DB) *AdminHandler {
|
||||
adminHandler := &AdminHandler{
|
||||
AuthHandler: NewAuthHandler(db),
|
||||
ProfileHandler: NewProfileHandler(db),
|
||||
PermissionHandler: NewPermissionHandler(db),
|
||||
AssignmentHandler: NewAssignmentHandler(db),
|
||||
TokenHandler: NewTokenHandler(db),
|
||||
MailAccountHandler: NewMailAccountHandler(db),
|
||||
MailHandler: NewMailHandler(db),
|
||||
}
|
||||
return adminHandler
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"kontor-api-echo/internal/models"
|
||||
"kontor-api-echo/internal/repository"
|
||||
"kontor-api-echo/internal/service"
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v5"
|
||||
"github.com/uptrace/bun"
|
||||
)
|
||||
|
||||
type AssignmentHandler struct {
|
||||
Service *service.AssignmentService
|
||||
}
|
||||
|
||||
func NewAssignmentHandler(db *bun.DB) *AssignmentHandler {
|
||||
handler := &AssignmentHandler{Service: service.NewAssignmentService(repository.NewAssignmentRepository(db))}
|
||||
return handler
|
||||
}
|
||||
|
||||
func (handler *AssignmentHandler) List(c *echo.Context) {
|
||||
assignments, err := handler.Service.List(c.Request().Context())
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, map[string]string{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
dtos := models.ConvertAssignmentsToDtos(assignments)
|
||||
c.JSON(http.StatusOK, dtos)
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package handlers
|
||||
|
||||
import "github.com/uptrace/bun"
|
||||
|
||||
type MediaHandler struct {
|
||||
MediaArticleHandler *MediaArticleHandler
|
||||
MediaActorHandler *MediaActorHandler
|
||||
MediaFileHandler *MediaFileHandler
|
||||
MediaLoFiHandler *MediaLoFiHandler
|
||||
MediaMusicHandler *MediaMusicHandler
|
||||
MediaVideoHandler *MediaVideoHandler
|
||||
MediaActorFileHandler *MediaActorFileHandler
|
||||
}
|
||||
|
||||
func NewMediaHandler(db *bun.DB) *MediaHandler {
|
||||
mediaHandler := &MediaHandler{
|
||||
MediaArticleHandler: NewMediaArticleHandler(db),
|
||||
MediaActorHandler: NewMediaActorHandler(db),
|
||||
MediaFileHandler: NewMediaFileHandler(db),
|
||||
MediaLoFiHandler: NewMediaLoFiHandler(db),
|
||||
MediaMusicHandler: NewMediaMusicHandler(db),
|
||||
MediaVideoHandler: NewMediaVideoHandler(db),
|
||||
MediaActorFileHandler: NewMediaActorFileHandler(db),
|
||||
}
|
||||
return mediaHandler
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"kontor-api-echo/internal/globals"
|
||||
"kontor-api-echo/internal/models"
|
||||
"kontor-api-echo/internal/repository"
|
||||
"kontor-api-echo/internal/service"
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v5"
|
||||
"github.com/uptrace/bun"
|
||||
)
|
||||
|
||||
type MediaActorHandler struct {
|
||||
Service *service.MediaActorService
|
||||
}
|
||||
|
||||
func NewMediaActorHandler(db *bun.DB) *MediaActorHandler {
|
||||
mediaActorHandler := &MediaActorHandler{
|
||||
Service: service.NewMediaActorService(repository.NewMediaActorRepository(db)),
|
||||
}
|
||||
return mediaActorHandler
|
||||
}
|
||||
|
||||
func (handler *MediaActorHandler) List(c *echo.Context) {
|
||||
lofis, err := handler.Service.List(c.Request().Context())
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, map[string]string{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
dtos := models.ConvertMediaActorsToDtos(lofis)
|
||||
c.JSON(http.StatusOK, dtos)
|
||||
}
|
||||
|
||||
func (handler *MediaActorHandler) Get(c *echo.Context) {
|
||||
id := c.Param("id")
|
||||
actor, err := handler.Service.Get(c.Request().Context(), id)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusNotFound, map[string]string{"error": "sport not found"})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, actor)
|
||||
}
|
||||
|
||||
func (handler *MediaActorHandler) Add(c *echo.Context) {
|
||||
var input models.MediaActorAdd
|
||||
|
||||
if err := c.Bind(&input); err != nil {
|
||||
c.JSON(http.StatusBadRequest, map[string]string{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
actor, err := handler.Service.Add(c.Request().Context(), input.WebLink)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusNotFound, map[string]string{"error": "lofi not added"})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, actor)
|
||||
}
|
||||
|
||||
func (handler *MediaActorHandler) Delete(c *echo.Context) {
|
||||
id := c.Param("id")
|
||||
err := handler.Service.Delete(c.Request().Context(), id)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusNotFound, map[string]string{"error": "sport not found"})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, map[string]string{"ok": "true"})
|
||||
}
|
||||
|
||||
func (handler *MediaActorHandler) ListPage(c *echo.Context) {
|
||||
cookie, err := c.Cookie(globals.UserKey)
|
||||
user := cookie.Value
|
||||
actors, err := handler.Service.List(c.Request().Context())
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, map[string]string{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
data := globals.GetDefaultValues(user, "MediaActors...")
|
||||
data["actors"] = actors
|
||||
c.Render(http.StatusOK, "media_actors", data)
|
||||
}
|
||||
|
||||
func (handler *MediaActorHandler) EditPage(c *echo.Context) {
|
||||
cookie, err := c.Cookie(globals.UserKey)
|
||||
user := cookie.Value
|
||||
id := c.Param("id")
|
||||
//logger := slog.Get(c)
|
||||
actor, err := handler.Service.Get(c.Request().Context(), id)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, map[string]string{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
data := globals.GetDefaultValues(user, "MediaActors...")
|
||||
data["actor"] = actor
|
||||
c.Render(http.StatusOK, "actor_detail", data)
|
||||
}
|
||||
|
||||
func (handler *MediaActorHandler) UpdatePage(c *echo.Context) {
|
||||
cookie, err := c.Cookie(globals.UserKey)
|
||||
user := cookie.Value
|
||||
id := c.Param("id")
|
||||
logger := c.Logger()
|
||||
actor, err := handler.Service.Get(c.Request().Context(), id)
|
||||
if err != nil {
|
||||
logger.Info("MediaActorHandler#UpdatePage", "error", err.Error())
|
||||
c.JSON(http.StatusInternalServerError, map[string]string{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
var form models.MediaActorForm
|
||||
if err := c.Bind(&form); err != nil {
|
||||
logger.Info("MediaActorHandler#UpdatePage", "error", err.Error())
|
||||
data := globals.GetDefaultValues(user, "MediaActors...")
|
||||
data["actor"] = actor
|
||||
data["Form"] = form
|
||||
data["Errors"] = err.Error()
|
||||
c.Render(http.StatusBadRequest, "actor_detail", data)
|
||||
return
|
||||
}
|
||||
logger.Info("MediaActorHandler#UpdatePage", "actor", actor)
|
||||
//handler.Service.Update(c.Request.Context(), form.ConvertFormToMediaLofiDTO())
|
||||
c.Redirect(http.StatusFound, globals.MediaActorLink)
|
||||
}
|
||||
|
||||
func (handler *MediaActorHandler) DeletePage(c *echo.Context) {
|
||||
//session := sessions.Default(c)
|
||||
//user := session.Get(globals.UserKey)
|
||||
id := c.Param("id")
|
||||
logger := c.Logger()
|
||||
//actor, err := handler.Service.Get(c.Request.Context(), id)
|
||||
// if err != nil {
|
||||
// logger.Info("MediaActorHandler#DeletePage", "error", err.Error())
|
||||
// c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||
// return
|
||||
// }
|
||||
logger.Info("MediaActorHandler#DeletePage", "actor", id)
|
||||
c.Redirect(http.StatusFound, globals.MediaActorLink)
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"kontor-api-echo/internal/globals"
|
||||
"kontor-api-echo/internal/models"
|
||||
"kontor-api-echo/internal/repository"
|
||||
"kontor-api-echo/internal/service"
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v5"
|
||||
"github.com/uptrace/bun"
|
||||
)
|
||||
|
||||
type MediaActorFileHandler struct {
|
||||
Service *service.MediaActorFileService
|
||||
}
|
||||
|
||||
func NewMediaActorFileHandler(db *bun.DB) *MediaActorFileHandler {
|
||||
mediaActorFileHandler := &MediaActorFileHandler{
|
||||
Service: service.NewMediaActorFileService(repository.NewMediaActorFileRepository(db)),
|
||||
}
|
||||
return mediaActorFileHandler
|
||||
}
|
||||
|
||||
func (handler *MediaActorFileHandler) List(c *echo.Context) {
|
||||
media_actor_files, err := handler.Service.List(c.Request().Context())
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, map[string]string{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
dtos := models.ConvertMediaActorFilesToDtos(media_actor_files)
|
||||
c.JSON(http.StatusOK, dtos)
|
||||
}
|
||||
|
||||
func (handler *MediaActorFileHandler) Get(c *echo.Context) {
|
||||
id := c.Param("id")
|
||||
actor, err := handler.Service.Get(c.Request().Context(), id)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusNotFound, map[string]string{"error": "sport not found"})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, actor)
|
||||
}
|
||||
|
||||
func (handler *MediaActorFileHandler) Add(c *echo.Context) {
|
||||
var input models.MediaActorFileAdd
|
||||
|
||||
if err := c.Bind(&input); err != nil {
|
||||
c.JSON(http.StatusBadRequest, map[string]string{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
actorfile, err := handler.Service.Add(c.Request().Context(), input.MediaActorID, input.MediaFileID)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusNotFound, map[string]string{"error": "lofi not added"})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, actorfile)
|
||||
}
|
||||
|
||||
func (handler *MediaActorFileHandler) Delete(c *echo.Context) {
|
||||
id := c.Param("id")
|
||||
err := handler.Service.Delete(c.Request().Context(), id)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusNotFound, map[string]string{"error": "sport not found"})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, map[string]string{"ok": "true"})
|
||||
}
|
||||
|
||||
func (handler *MediaActorFileHandler) ListPage(c *echo.Context) {
|
||||
cookie, err := c.Cookie(globals.UserKey)
|
||||
user := cookie.Value
|
||||
media_actor_files, err := handler.Service.List(c.Request().Context())
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, map[string]string{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
c.Render(http.StatusOK, "mediaactorfiles", map[string]string{
|
||||
"title": "Kontor MediaActorFiles",
|
||||
"version": "0.4.0",
|
||||
"message": "MediaActorFiles...",
|
||||
"actors": media_actor_files,
|
||||
"user": user,
|
||||
})
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user