Compare commits
57 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d80aefe6b2 | |||
| 652378e7de | |||
| 57b942a9ca | |||
| bda453a92a | |||
| a113f08ddc | |||
| cc631a14ed | |||
| 9476d8853e | |||
| 8cc58aed5b | |||
| ec274a60d9 | |||
| 5b7c41c829 | |||
| f73ec33aeb | |||
| cdde57e033 | |||
| 9d07ed9bfb | |||
| 59e705d012 | |||
| 3b50a94928 | |||
| fd5bb14e77 | |||
| a786607608 | |||
| 031d71406c | |||
| 48149b67cf | |||
| 9f0a0c1d1e | |||
| 7555cfd51d | |||
| ea038ec70c | |||
| ecfa0eb6d8 | |||
| fe63a80b23 | |||
| 567e254840 | |||
| a4975928ae | |||
| 1dcf342736 | |||
| 6abbe2e585 | |||
| 8eecd47399 | |||
| 9d01925097 | |||
| bd721a8e64 | |||
| c4932a4665 | |||
| def3f7ea11 | |||
| bef7b0bd59 | |||
| 5655bc5322 | |||
| 375438a8fa | |||
| 90b1e8def3 | |||
| 816165579c | |||
| fbcdbb3e1a | |||
| e46ab25920 | |||
| 1fa64bf5ce | |||
| fdb9da358a | |||
| 235f64aa08 | |||
| 9f17823922 | |||
| 0c6b26b79e | |||
| c7a322f29d | |||
| 32dcd43fe5 | |||
| 5edb929b0f | |||
| f0cf98d36e | |||
| 19e7eba250 | |||
| 81d6018e0f | |||
| c685e9aca5 | |||
| d39c14cd9a | |||
| 2ce6bbc083 | |||
| 3a351ac5b7 | |||
| 31c01c3033 | |||
| 0d5ee0dd63 |
@@ -6,3 +6,9 @@ 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
|
||||
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
# 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
|
||||
|
||||
@@ -14,7 +14,6 @@ ENV PATH="/root/.local/bin:${PATH}"
|
||||
WORKDIR /app
|
||||
|
||||
COPY ./pyproject.toml .
|
||||
|
||||
RUN uv sync
|
||||
|
||||
# ------------------------------- Production Stage ------------------------------ ##
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "kontor-api"
|
||||
version = "0.1.0"
|
||||
version = "0.4.0"
|
||||
description = "Add your description here"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.13"
|
||||
@@ -24,9 +24,21 @@ 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",
|
||||
"kontor-model",
|
||||
]
|
||||
|
||||
[[tool.uv.index]]
|
||||
name = "nexus"
|
||||
url = "https://nexus.thpeetz.de/repository/pypi-group/simple"
|
||||
publish-url = "https://nexus.thpeetz.de/repository/pypi-internal/"
|
||||
default = true
|
||||
|
||||
|
||||
[[tool.uv.index]]
|
||||
name = "nexus-proxy"
|
||||
url = "https://nexus.thpeetz.de/repository/pypi-proxy/simple"
|
||||
|
||||
@@ -18,6 +18,7 @@ from src.apis.version1.comics import (
|
||||
from src.apis.version1.media import (
|
||||
actor,
|
||||
file,
|
||||
lofi,
|
||||
mediaactorfile,
|
||||
mediavideo,
|
||||
mediaarticle,
|
||||
@@ -104,6 +105,12 @@ 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",
|
||||
|
||||
@@ -9,8 +9,8 @@ from src.core.security import (
|
||||
authenticate_user_by_username,
|
||||
create_access_token,
|
||||
)
|
||||
from src.schema.admin.login import LoginRequest
|
||||
from src.schema.admin.token import Token
|
||||
from kontor_model.schema.admin.login import LoginRequest
|
||||
from kontor_model.schema.admin.token import Token
|
||||
from src.webapps.auth.forms import LoginForm
|
||||
|
||||
login_router = APIRouter()
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.admin import MailAccount
|
||||
from kontor_model.db.models.admin import MailAccount
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.admin.mailaccount import MailAccountResponse, to_response
|
||||
from kontor_model.schema.admin.mailaccount import MailAccountResponse, to_response
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from src.db.models.bookshelf import Article
|
||||
from kontor_model.db.models.bookshelf import Article
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.bookshelf.article import ArticleResponse, to_response
|
||||
from kontor_model.schema.bookshelf.article import ArticleResponse, to_response
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from src.db.models.bookshelf import ArticleAuthor
|
||||
from kontor_model.db.models.bookshelf import ArticleAuthor
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.bookshelf.articleauthor import ArticleAuthorResponse, to_response
|
||||
from kontor_model.schema.bookshelf.articleauthor import ArticleAuthorResponse, to_response
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.bookshelf import Author
|
||||
from kontor_model.db.models.bookshelf import Author
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.bookshelf.author import AuthorResponse, to_response
|
||||
from kontor_model.schema.bookshelf.author import AuthorResponse, to_response
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from src.db.models.bookshelf import Book
|
||||
from kontor_model.db.models.bookshelf import Book
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.bookshelf.book import BookResponse, to_response
|
||||
from kontor_model.schema.bookshelf.book import BookResponse, to_response
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from src.db.models.bookshelf import BookAuthor
|
||||
from kontor_model.db.models.bookshelf import BookAuthor
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.bookshelf.bookauthor import BookAuthorResponse, to_response
|
||||
from kontor_model.schema.bookshelf.bookauthor import BookAuthorResponse, to_response
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from src.db.models.bookshelf import BookshelfPublisher
|
||||
from kontor_model.db.models.bookshelf import BookshelfPublisher
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.bookshelf.publisher import PublisherResponse, to_response
|
||||
from kontor_model.schema.bookshelf.publisher import PublisherResponse, to_response
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException, status
|
||||
|
||||
from src.db.models.comic import Artist
|
||||
from src.db.repository.comics.artist import get_artist_details
|
||||
from kontor_model.db.models.comic import Artist
|
||||
from kontor_model.db.repository.comics.artist import get_artist_details
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.comics.artist import ArtistCreation, ArtistResponse, artist_to_response
|
||||
from src.schema.comics.artist_details import ArtistDetailResponse
|
||||
from kontor_model.schema.comics.artist import ArtistCreation, ArtistResponse, artist_to_response
|
||||
from kontor_model.schema.comics.artist_details import ArtistDetailResponse
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -3,13 +3,13 @@ from typing import List
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.core.log_conf import logger
|
||||
from src.db.models.comic import Comic
|
||||
from src.db.repository.comics.comic import (
|
||||
from kontor_model.db.models.comic import Comic
|
||||
from kontor_model.db.repository.comics.comic import (
|
||||
get_comic_details,
|
||||
)
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.comics.comic import ComicResponse, comic_to_response
|
||||
from src.schema.comics.comic_details import ComicDetailsResponse
|
||||
from kontor_model.schema.comics.comic import ComicResponse, comic_to_response
|
||||
from kontor_model.schema.comics.comic_details import ComicDetailsResponse
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.comic import ComicWork
|
||||
from kontor_model.db.models.comic import ComicWork
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.comics.comicwork import ComicWorkResponse, comicwork_to_response
|
||||
from kontor_model.schema.comics.comicwork import ComicWorkResponse, comicwork_to_response
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.comic import Issue
|
||||
from kontor_model.db.models.comic import Issue
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.comics.issue import IssueResponse, issue_to_response
|
||||
from kontor_model.schema.comics.issue import IssueResponse, issue_to_response
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.comic import IssueWork
|
||||
from kontor_model.db.models.comic import IssueWork
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.comics.issuework import IssueWorkResponse, issuework_to_response
|
||||
from kontor_model.schema.comics.issuework import IssueWorkResponse, issuework_to_response
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -2,11 +2,11 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.comic import Publisher
|
||||
from src.db.repository.comics.publisher import get_publisher_details
|
||||
from kontor_model.db.models.comic import Publisher
|
||||
from kontor_model.db.repository.comics.publisher import get_publisher_details
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.comics.publisher import PublisherResponse, publisher_to_response
|
||||
from src.schema.comics.publisher_details import PublisherDetailsResponse
|
||||
from kontor_model.schema.comics.publisher import PublisherResponse, publisher_to_response
|
||||
from kontor_model.schema.comics.publisher_details import PublisherDetailsResponse
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.comic import StoryArc
|
||||
from kontor_model.db.models.comic import StoryArc
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.comics.storyarc import StoryArcResponse, storyarc_to_response
|
||||
from kontor_model.schema.comics.storyarc import StoryArcResponse, storyarc_to_response
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.comic import Volume
|
||||
from kontor_model.db.models.comic import Volume
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.comics.volume import VolumeResponse, volume_to_response
|
||||
from kontor_model.schema.comics.volume import VolumeResponse, volume_to_response
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.comic import WorkType
|
||||
from kontor_model.db.models.comic import WorkType
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.comics.worktype import WorktypeResponse, worktype_to_response
|
||||
from kontor_model.schema.comics.worktype import WorktypeResponse, worktype_to_response
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from fastapi import APIRouter, status
|
||||
|
||||
from src.schema.admin.healthcheck import HealthCheck
|
||||
from kontor_model.schema.admin.healthcheck import HealthCheck
|
||||
|
||||
health_router = APIRouter()
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ from typing import List
|
||||
|
||||
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 kontor_model.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
|
||||
from src.db.models.media import MediaActor
|
||||
from kontor_model.schema.media.actor import MediaActorModel, MediaActorResponse, actor_to_response
|
||||
from kontor_model.db.models.media import MediaActor
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -2,21 +2,21 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, status, HTTPException
|
||||
from src.core.log_conf import logger
|
||||
from src.db.repository.media.actorfile import (
|
||||
from kontor_model.db.repository.media.actorfile import (
|
||||
create_new_mediaactorfile,
|
||||
delete_mediaactorfile,
|
||||
)
|
||||
from src.db.repository.media.file import delete_mediafile, import_mediafile
|
||||
from kontor_model.db.repository.media.file import delete_mediafile, import_mediafile
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.media.actor import MediaActorResponse, actor_to_response
|
||||
from src.schema.media.actorfile import MediaActorFileResponse, actorfile_to_response
|
||||
from src.schema.media.file import (
|
||||
from kontor_model.schema.media.actor import MediaActorResponse, actor_to_response
|
||||
from kontor_model.schema.media.actorfile import MediaActorFileResponse, actorfile_to_response
|
||||
from kontor_model.schema.media.file import (
|
||||
MediaFileModel,
|
||||
MediaFileResponse,
|
||||
file_to_response,
|
||||
file_to_model,
|
||||
)
|
||||
from src.db.models.media import MediaFile
|
||||
from kontor_model.db.models.media import MediaFile
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
|
||||
from typing import List
|
||||
|
||||
from fastapi import APIRouter, status, HTTPException
|
||||
|
||||
from kontor_model.db.models.media import MediaLofi
|
||||
from src.db.session import SessionDep
|
||||
from src.core.log_conf import logger
|
||||
from kontor_model.schema.media.lofi import (
|
||||
MediaLofiModel,
|
||||
MediaLofiResponse,
|
||||
lofi_to_response,
|
||||
lofi_to_model
|
||||
)
|
||||
from kontor_model.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,9 +1,10 @@
|
||||
from typing import List
|
||||
from fastapi import APIRouter, status, HTTPException
|
||||
from src.db.models.media import MediaActorFile
|
||||
from src.db.repository.media.actorfile import delete_mediaactorfile
|
||||
from src.core.log_conf import logger
|
||||
from kontor_model.db.models.media import MediaActorFile
|
||||
from kontor_model.db.repository.media.actorfile import delete_mediaactorfile, import_mediaactorfile
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.media.actorfile import MediaActorFileResponse, actorfile_to_response
|
||||
from kontor_model.schema.media.actorfile import MediaActorFileModel, MediaActorFileResponse, actorfile_to_response
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -30,3 +31,13 @@ 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
|
||||
|
||||
@@ -3,9 +3,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from src.db.models.media import MediaArticle
|
||||
from kontor_model.db.models.media import MediaArticle
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.media.article import MediaArticleResponse, to_response
|
||||
from kontor_model.schema.media.article import MediaArticleResponse, to_response
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.media import MediaVideo
|
||||
from kontor_model.db.models.media import MediaVideo
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.media.video import MediaVideoResponse, video_to_response
|
||||
from kontor_model.schema.media.video import MediaVideoResponse, video_to_response
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.tysc import Card
|
||||
from kontor_model.db.models.tysc import Card
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.tysc.card import CardResponse, to_response
|
||||
from kontor_model.schema.tysc.card import CardResponse, to_response
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.tysc import CardSet
|
||||
from kontor_model.db.models.tysc import CardSet
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.tysc.cardset import CardSetResponse, to_response
|
||||
from kontor_model.schema.tysc.cardset import CardSetResponse, to_response
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.tysc import FieldPosition
|
||||
from kontor_model.db.models.tysc import FieldPosition
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.tysc.fieldposition import FieldPositionResponse, to_response
|
||||
from kontor_model.schema.tysc.fieldposition import FieldPositionResponse, to_response
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.tysc import Player
|
||||
from kontor_model.db.models.tysc import Player
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.tysc.player import PlayerResponse, to_response
|
||||
from kontor_model.schema.tysc.player import PlayerResponse, to_response
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.tysc import Rooster
|
||||
from kontor_model.db.models.tysc import Rooster
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.tysc.rooster import RoosterResponse, to_response
|
||||
from kontor_model.schema.tysc.rooster import RoosterResponse, to_response
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -3,8 +3,8 @@ from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.core.log_conf import logger
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.tysc.sport import SportResponse, to_response
|
||||
from src.db.models.tysc import Sport
|
||||
from kontor_model.schema.tysc.sport import SportResponse, to_response
|
||||
from kontor_model.db.models.tysc import Sport
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.tysc import Team
|
||||
from kontor_model.db.models.tysc import Team
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.tysc.team import TeamResponse, to_response
|
||||
from kontor_model.schema.tysc.team import TeamResponse, to_response
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.tysc import Vendor
|
||||
from kontor_model.db.models.tysc import Vendor
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.tysc.vendor import VendorResponse, to_response
|
||||
from kontor_model.schema.tysc.vendor import VendorResponse, to_response
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.admin import Assignment
|
||||
from kontor_model.db.models.admin import Assignment
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.user.assignment import AssignmentResponse, to_response
|
||||
from kontor_model.schema.user.assignment import AssignmentResponse, to_response
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from src.db.models.admin import Permission
|
||||
from kontor_model.db.models.admin import Permission
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.user.permission import PermissionResponse, to_response
|
||||
from kontor_model.schema.user.permission import PermissionResponse, to_response
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@ from sqlalchemy import select
|
||||
from src.core.log_conf import logger
|
||||
|
||||
from src.core.security import CurrentUser
|
||||
from src.db.models.admin import Profile
|
||||
from kontor_model.db.models.admin import Profile
|
||||
from src.db.repository.user import create_new_profile
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.user.profile import ProfileResponse, ProfileModel, to_response
|
||||
from kontor_model.schema.user.profile import ProfileResponse, ProfileModel, to_response
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -2,9 +2,9 @@ from typing import List
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from src.db.models.admin import Token
|
||||
from kontor_model.db.models.admin import Token
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.user.token import TokenResponse, to_response
|
||||
from kontor_model.schema.user.token import TokenResponse, to_response
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -9,17 +9,21 @@ load_dotenv(dotenv_path=env_path)
|
||||
|
||||
class Settings:
|
||||
PROJECT_NAME: str = "Kontor"
|
||||
PROJECT_VERSION: str = "0.3.0"
|
||||
PROJECT_VERSION: str = "0.4.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()
|
||||
|
||||
|
||||
@@ -15,15 +15,15 @@ from pydantic import ValidationError
|
||||
|
||||
from src.core.config import settings
|
||||
from src.core.log_conf import logger
|
||||
from src.db.models.admin import Profile
|
||||
from src.db.repository.admin import (
|
||||
from kontor_model.db.models.admin import Profile
|
||||
from kontor_model.db.repository.admin import (
|
||||
get_profile_by_username,
|
||||
get_profile_by_email,
|
||||
is_database_empty,
|
||||
)
|
||||
from src.db.session import SessionLocal
|
||||
from src.schema.admin.token import TokenData
|
||||
from src.schema.user.profile import ProfileModel, to_model
|
||||
from kontor_model.schema.admin.token import TokenData
|
||||
from kontor_model.schema.user.profile import ProfileModel, to_model
|
||||
|
||||
oauth2_scheme = OAuth2PasswordBearer(
|
||||
tokenUrl="/token",
|
||||
@@ -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 current_user.enabled:
|
||||
if not bool(current_user.enabled):
|
||||
raise HTTPException(status_code=400, detail="Inactive user")
|
||||
user_model = to_model(current_user)
|
||||
return user_model
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
from datetime import datetime
|
||||
from typing import List
|
||||
|
||||
from sqlalchemy import ForeignKey
|
||||
from sqlalchemy.orm import relationship, mapped_column, Mapped
|
||||
|
||||
from src.db.models.base import Base, BaseMixin
|
||||
|
||||
|
||||
class Profile(Base, BaseMixin):
|
||||
__tablename__ = 'profile'
|
||||
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 = ""
|
||||
if self.first_name is not None:
|
||||
full_name += str(self.first_name)
|
||||
if self.last_name is not None:
|
||||
if len(full_name) > 0:
|
||||
full_name += " "
|
||||
full_name += str(self.last_name)
|
||||
return full_name
|
||||
|
||||
def __str__(self):
|
||||
return f"Profile({self.id} {self.user_name}, {self.email})"
|
||||
|
||||
|
||||
class Token(Base, BaseMixin):
|
||||
__tablename__ = "token"
|
||||
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: Mapped[str] = mapped_column(nullable=False)
|
||||
assignments: Mapped[List["Assignment"]] = relationship(back_populates="permission")
|
||||
|
||||
|
||||
class Assignment(Base, BaseMixin):
|
||||
__tablename__ = "assignment"
|
||||
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: 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]
|
||||
subject: Mapped[str]
|
||||
body: Mapped[str]
|
||||
sent_date: Mapped[datetime]
|
||||
received_date: Mapped[datetime]
|
||||
@@ -1,52 +0,0 @@
|
||||
from typing import List
|
||||
|
||||
from sqlalchemy import Column, ForeignKey, Integer, String
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from src.db.models.base import Base, BaseMixin
|
||||
|
||||
|
||||
class Article(Base, BaseMixin):
|
||||
__tablename__ = 'article'
|
||||
title: Mapped[str] = mapped_column(unique=True)
|
||||
article_authors = relationship("ArticleAuthor")
|
||||
|
||||
|
||||
class Author(Base, BaseMixin):
|
||||
__tablename__ = 'author'
|
||||
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: Mapped[str] = mapped_column(unique=True)
|
||||
books: Mapped[List["Book"]] = relationship(back_populates="publisher")
|
||||
|
||||
|
||||
class Book(Base, BaseMixin):
|
||||
__tablename__ = 'book'
|
||||
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: 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: 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")
|
||||
@@ -1,188 +0,0 @@
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from typing import Dict, List, Optional, Any
|
||||
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
|
||||
|
||||
|
||||
class Publisher(Base):
|
||||
__tablename__ = "publisher"
|
||||
id: Mapped[str] = mapped_column(primary_key=True, default=uuid.uuid4)
|
||||
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: 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(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})'
|
||||
|
||||
def __str__(self):
|
||||
return self.__repr__()
|
||||
|
||||
|
||||
class Comic(Base, BaseMixin):
|
||||
__tablename__ = 'comic'
|
||||
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})'
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.title}({self.id})'
|
||||
|
||||
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 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: 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")
|
||||
|
||||
|
||||
class TradePaperback(Base, BaseMixin):
|
||||
__tablename__ = "trade_paperback"
|
||||
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: 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: 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 get_full_title(self) -> str:
|
||||
full_title: str = str(self.issue_number)
|
||||
if self.title:
|
||||
full_title += str(": " + self.title)
|
||||
return full_title
|
||||
|
||||
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: 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 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: 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)})'
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.name}({self.id})'
|
||||
|
||||
|
||||
class ComicWork(Base, BaseMixin):
|
||||
__tablename__ = "comic_work"
|
||||
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: 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,100 +0,0 @@
|
||||
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
|
||||
|
||||
|
||||
class Sport(Base, BaseMixin):
|
||||
__tablename__ = "sport"
|
||||
__table_args__ = (
|
||||
UniqueConstraint("name"),
|
||||
)
|
||||
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")
|
||||
|
||||
|
||||
class Team(Base, BaseMixin):
|
||||
__tablename__ = "team"
|
||||
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")
|
||||
|
||||
|
||||
class FieldPosition(Base, BaseMixin):
|
||||
__tablename__ = "field_position"
|
||||
__table_args__ = (
|
||||
UniqueConstraint("name", "sport_id"),
|
||||
UniqueConstraint("short_name", "sport_id"),
|
||||
)
|
||||
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):
|
||||
__tablename__ = "player"
|
||||
__table_args__ = (
|
||||
UniqueConstraint("first_name", "last_name"),
|
||||
)
|
||||
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}"
|
||||
|
||||
|
||||
class Rooster(Base, BaseMixin):
|
||||
__tablename__ = "rooster"
|
||||
__table_args__ = (
|
||||
UniqueConstraint("year", "team_id", "player_id", "position_id"),
|
||||
)
|
||||
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: 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):
|
||||
__tablename__ = "card_set"
|
||||
__table_args__ = (
|
||||
UniqueConstraint("name", "vendor_id"),
|
||||
)
|
||||
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):
|
||||
__tablename__ = "card"
|
||||
__table_args__ = (
|
||||
UniqueConstraint("card_number", "year", "vendor_id", "card_set_id"),
|
||||
)
|
||||
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,24 +0,0 @@
|
||||
from typing import List
|
||||
|
||||
from src.db.models.comic import Publisher
|
||||
from src.schema.comics.comic import ComicResponse
|
||||
from src.schema.comics.publisher import PublisherResponse
|
||||
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, name=str(imprint.name)))
|
||||
comics: List[ComicResponse] = []
|
||||
for comic in publisher.comics:
|
||||
comics.append(
|
||||
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, name=str(publisher.parent_publisher.name))
|
||||
response: PublisherDetailsResponse = PublisherDetailsResponse(
|
||||
id=publisher.id, name=str(publisher.name), parent_publisher=parent_publisher, imprints=imprints, comics=comics
|
||||
)
|
||||
return response
|
||||
@@ -2,10 +2,10 @@ 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 kontor_model.db.models.admin import Assignment, Profile
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from src.schema.user.profile import ProfileModel
|
||||
from kontor_model.schema.user.profile import ProfileModel
|
||||
|
||||
|
||||
def create_new_profile(new_profile: ProfileModel, db: Session) -> Profile:
|
||||
|
||||
@@ -10,7 +10,7 @@ from src.apis.version1.admin.login import login_router
|
||||
from src.core.config import settings
|
||||
from src.core.log_conf import logger
|
||||
from src.core.middleware import RequestLoggingMiddleware
|
||||
from src.db.models.base import Base
|
||||
from kontor_model.db.models.base import Base
|
||||
from src.db.session import engine
|
||||
from src.db.utils import check_db_connected, check_db_disconnected
|
||||
from src.webapps.base import api_router as web_app_router
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
{% 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 %}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
{% 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 %}
|
||||
@@ -0,0 +1,29 @@
|
||||
{% extends "shared/base.html" %}
|
||||
|
||||
{% block title %}
|
||||
<title>Lofi Links</title>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% with msg=msg %}
|
||||
{% include "components/alerts.html" %}
|
||||
{% endwith %}
|
||||
<div class="container">
|
||||
<table class="table table-hover">
|
||||
<thead><tr>
|
||||
<th scope="col">Titel</th>
|
||||
<th scope="col">Review</th>
|
||||
<th scope="col">Download</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
{% for medialofi in medialofis %}
|
||||
<tr>
|
||||
<th scope="row"><a href="/media/lofi/{{medialofi.id}}">{{medialofi.title}}</a></th>
|
||||
<td>{% with check=medialofi.review %}{% include "components/check.html" %}{% endwith %}</td>
|
||||
<td>{% with check=medialofi.should_download %}{% include "components/check.html" %}{% endwith %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -2,4 +2,5 @@
|
||||
<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>
|
||||
|
||||
@@ -2,7 +2,7 @@ from typing import Optional
|
||||
from fastapi import APIRouter, Request
|
||||
from fastapi.templating import Jinja2Templates
|
||||
|
||||
from src.db.models.admin import Permission, Profile
|
||||
from kontor_model.db.models.admin import Permission, Profile
|
||||
from src.db.session import SessionDep
|
||||
|
||||
templates = Jinja2Templates(directory="src/templates")
|
||||
|
||||
@@ -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_media, route_videos
|
||||
from src.webapps.media import route_actors, route_lofi, route_media, route_videos
|
||||
|
||||
templates = Jinja2Templates(directory="src/templates")
|
||||
|
||||
@@ -15,6 +15,7 @@ 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"])
|
||||
|
||||
|
||||
@@ -2,14 +2,13 @@ from fastapi import APIRouter, Request, status, Form
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from fastapi.responses import RedirectResponse
|
||||
|
||||
from src.db.models.comic import Artist
|
||||
from kontor_model.db.models.comic import Artist
|
||||
from typing import AnyStr
|
||||
|
||||
from src.db.repository.comics.artist import update_artist
|
||||
from kontor_model.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 kontor_model.schema.comics.artist import AddArtist
|
||||
from src.webapps.comic.forms.artist import AddArtistForm
|
||||
|
||||
#from src.schema.comics.worktype import AddWorkType
|
||||
@@ -35,7 +34,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(request: Request, db: SessionDep, artist_id: str, action: str = Form(...), artist_name: str = Form(...), artist_link: str = Form(...)):
|
||||
async def edit_artist_post(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)
|
||||
|
||||
@@ -2,12 +2,12 @@ from fastapi import APIRouter, Form, Request, status
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from fastapi.responses import RedirectResponse
|
||||
|
||||
from src.db.models.comic import Comic, Publisher, Issue
|
||||
from kontor_model.db.models.comic import Comic, Publisher, Issue
|
||||
from typing import AnyStr
|
||||
from src.core.log_conf import logger
|
||||
from src.db.repository.comics.comic import update_comic
|
||||
from kontor_model.db.repository.comics.comic import update_comic
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.comics.comic import ComicSchema
|
||||
from kontor_model.schema.comics.comic import ComicSchema
|
||||
from src.webapps.comic.forms.comic import ValidateComicForm
|
||||
|
||||
templates = Jinja2Templates(directory="src/templates")
|
||||
|
||||
@@ -2,13 +2,13 @@ from fastapi import APIRouter, Request, status
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from fastapi.responses import RedirectResponse
|
||||
|
||||
from src.db.models.comic import WorkType
|
||||
from kontor_model.db.models.comic import WorkType
|
||||
from typing import AnyStr
|
||||
|
||||
from src.db.repository.comics.worktype import create_new_worktype, update_worktype
|
||||
from kontor_model.db.repository.comics.worktype import create_new_worktype, update_worktype
|
||||
from src.db.session import SessionDep
|
||||
from src.main import logger
|
||||
from src.schema.comics.worktype import AddWorkType
|
||||
from kontor_model.schema.comics.worktype import AddWorkType
|
||||
from src.webapps.comic.forms.worktype import AddWorktypeForm
|
||||
|
||||
templates = Jinja2Templates(directory="src/templates")
|
||||
|
||||
@@ -2,7 +2,7 @@ from typing import AnyStr
|
||||
|
||||
from fastapi import APIRouter, Request
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from src.db.models.media import MediaActor
|
||||
from kontor_model.db.models.media import MediaActor
|
||||
from src.db.session import SessionDep
|
||||
|
||||
templates = Jinja2Templates(directory="src/templates")
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
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
|
||||
|
||||
from src.core.security import get_current_user_from_token
|
||||
from kontor_model.db.models.media import MediaLofi
|
||||
from kontor_model.db.models.admin import Profile
|
||||
from kontor_model.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("/lofi")
|
||||
def get_medialofis(db: SessionDep, request: Request, msg: Optional[str] = None):
|
||||
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)
|
||||
return templates.TemplateResponse("media/lofi_list.html", {"request": request, "msg": msg, "user": current_user, "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("/lofi/{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("/add-lofi")
|
||||
def add_lofi_link(request: Request, db: SessionDep):
|
||||
return templates.TemplateResponse("media/add_lofi_link.html", {"request": request})
|
||||
|
||||
@router.post("/add-lofi")
|
||||
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__)
|
||||
@@ -6,8 +6,8 @@ from fastapi.templating import Jinja2Templates
|
||||
from sqlalchemy import or_
|
||||
|
||||
from src.core.security import get_current_user_from_token
|
||||
from src.db.models.admin import Profile
|
||||
from src.db.models.media import MediaFile
|
||||
from kontor_model.db.models.admin import Profile
|
||||
from kontor_model.db.models.media import MediaFile
|
||||
from src.core.log_conf import logger
|
||||
from src.db.session import SessionDep
|
||||
|
||||
@@ -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,11 +1,13 @@
|
||||
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
|
||||
|
||||
from src.core.security import get_current_user_from_token
|
||||
from src.db.models.media import MediaVideo
|
||||
from src.db.models.admin import Profile
|
||||
from src.db.repository.media.video import create_new_video
|
||||
from kontor_model.db.models.media import MediaVideo
|
||||
from kontor_model.db.models.admin import Profile
|
||||
from kontor_model.db.repository.media.video import create_new_video
|
||||
from src.db.session import SessionDep
|
||||
from src.webapps.media.forms import AddLinkForm
|
||||
|
||||
@@ -13,12 +15,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: str = None):
|
||||
def get_mediavideos(db: SessionDep, request: Request, msg: Optional[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, db=db)
|
||||
current_user: Profile = get_current_user_from_token(token=param)
|
||||
return templates.TemplateResponse("media/videos.html", {"request": request, "msg": msg, "user": current_user, "mediavideos": mediavideos})
|
||||
except Exception as e:
|
||||
print(e)
|
||||
@@ -40,7 +42,7 @@ async def post_video_link(request: Request, db: SessionDep):
|
||||
if form.is_valid():
|
||||
try:
|
||||
#video = AddLink(**form.__dict__)
|
||||
mediavideo = create_new_video(video=form, db=db)
|
||||
mediavideo = create_new_video(url=str(form.url), db=db)
|
||||
return responses.RedirectResponse(f"media/videos/{mediavideo.id}", status_code=status.HTTP_302_FOUND)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
@@ -11,7 +11,7 @@ from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import Session, sessionmaker
|
||||
|
||||
from src.apis.base import api_router
|
||||
from src.db.models.base import Base
|
||||
from kontor_model.db.models.base import Base
|
||||
from src.db.session import get_db
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
Generated
+1046
-534
File diff suppressed because it is too large
Load Diff
@@ -1,6 +0,0 @@
|
||||
def main():
|
||||
print("Hello from kontor-blacksheep!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,17 +0,0 @@
|
||||
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"])
|
||||
@@ -1,9 +0,0 @@
|
||||
[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",
|
||||
]
|
||||
@@ -1,23 +0,0 @@
|
||||
"""
|
||||
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=[],
|
||||
)
|
||||
@@ -1,12 +0,0 @@
|
||||
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
@@ -1,409 +0,0 @@
|
||||
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,11 +1,6 @@
|
||||
/*
|
||||
* 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"
|
||||
}
|
||||
|
||||
@@ -16,6 +11,39 @@ 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,5 +1,7 @@
|
||||
# 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,5 +1,6 @@
|
||||
#let version = sys.inputs.at("version", default: "0.0.1")
|
||||
//#set page("a4")
|
||||
#import "@preview/basic-report:0.4.0": *
|
||||
#import "@preview/basic-report:0.5.0": *
|
||||
#import "@preview/in-dexter:0.7.2": *
|
||||
#import "@preview/pintorita:0.1.4"
|
||||
|
||||
@@ -8,14 +9,12 @@
|
||||
|
||||
#show: it => basic-report(
|
||||
doc-category: "Entwicklungs- und Projekthandbuch",
|
||||
doc-title: "Projekt kontor",
|
||||
doc-title: "Projekt kontor\nVersion " + version,
|
||||
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,
|
||||
it
|
||||
show-outline: true,
|
||||
it,
|
||||
)
|
||||
|
||||
= Allgemeines
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
[project]
|
||||
name = "kontor_model"
|
||||
version = "0.4.0"
|
||||
description = "Kontor Model"
|
||||
readme = "README.md"
|
||||
authors = [
|
||||
{ name = "Thomas Peetz", email = "thomas.peetz@cimt-ag.de" }
|
||||
]
|
||||
requires-python = ">=3.13"
|
||||
dependencies = [
|
||||
"sqlalchemy>=2.0.52",
|
||||
"msgspec[toml,yaml]>=0.21.1",
|
||||
"pydantic[email]>=2.13.4",
|
||||
]
|
||||
|
||||
[build-system]
|
||||
requires = ["uv_build>=0.9.27,<0.10.0"]
|
||||
build-backend = "uv_build"
|
||||
|
||||
[[tool.uv.index]]
|
||||
name = "nexus"
|
||||
url = "https://nexus.thpeetz.de/repository/pypi-group/simple"
|
||||
publish-url = "https://nexus.thpeetz.de/repository/pypi-internal/"
|
||||
default = true
|
||||
|
||||
|
||||
[[tool.uv.index]]
|
||||
name = "nexus-proxy"
|
||||
url = "https://nexus.thpeetz.de/repository/pypi-proxy/simple"
|
||||
@@ -0,0 +1,2 @@
|
||||
def hello() -> str:
|
||||
return "Hello from kontor-model!"
|
||||
+7
-5
@@ -1,5 +1,5 @@
|
||||
from typing import Any, Dict
|
||||
from db.models.admin import (
|
||||
from kontor_model.db.models.admin import (
|
||||
Assignment,
|
||||
Token,
|
||||
Profile,
|
||||
@@ -7,7 +7,7 @@ from db.models.admin import (
|
||||
MailAccount,
|
||||
Mail,
|
||||
)
|
||||
from db.models.bookshelf import (
|
||||
from kontor_model.db.models.bookshelf import (
|
||||
ArticleAuthor,
|
||||
BookAuthor,
|
||||
BookshelfPublisher,
|
||||
@@ -15,7 +15,7 @@ from db.models.bookshelf import (
|
||||
Book,
|
||||
Author,
|
||||
)
|
||||
from db.models.comic import (
|
||||
from kontor_model.db.models.comic import (
|
||||
Issue,
|
||||
StoryArc,
|
||||
TradePaperback,
|
||||
@@ -27,14 +27,15 @@ from db.models.comic import (
|
||||
Publisher,
|
||||
WorkType,
|
||||
)
|
||||
from db.models.media import (
|
||||
from kontor_model.db.models.media import (
|
||||
MediaFile,
|
||||
MediaActor,
|
||||
MediaActorFile,
|
||||
MediaArticle,
|
||||
MediaVideo,
|
||||
MediaLofi,
|
||||
)
|
||||
from db.models.tysc import (
|
||||
from kontor_model.db.models.tysc import (
|
||||
Card,
|
||||
CardSet,
|
||||
Rooster,
|
||||
@@ -72,6 +73,7 @@ registry: Dict[str, Any] = {
|
||||
BookAuthor.__tablename__: BookAuthor,
|
||||
MediaArticle.__tablename__: MediaArticle,
|
||||
MediaVideo.__tablename__: MediaVideo,
|
||||
MediaLofi.__tablename__: MediaLofi,
|
||||
MediaFile.__tablename__: MediaFile,
|
||||
MediaActor.__tablename__: MediaActor,
|
||||
MediaActorFile.__tablename__: MediaActorFile,
|
||||
+1
-1
@@ -4,7 +4,7 @@ from typing import Any, Dict
|
||||
from sqlalchemy import Column, ForeignKey, Integer, String, Boolean
|
||||
from sqlalchemy.orm import relationship, mapped_column, Mapped
|
||||
|
||||
from db.models.base import Base, BaseMixin
|
||||
from kontor_model.db.models.base import Base, BaseMixin
|
||||
|
||||
|
||||
class Profile(Base, BaseMixin):
|
||||
+2
-2
@@ -2,7 +2,7 @@ from typing import Any, Dict
|
||||
from sqlalchemy import Column, ForeignKey, Integer, String
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from db.models.base import Base, BaseMixin
|
||||
from kontor_model.db.models.base import Base, BaseMixin
|
||||
|
||||
|
||||
class Article(Base, BaseMixin):
|
||||
@@ -56,7 +56,7 @@ class Author(Base, BaseMixin):
|
||||
class BookshelfPublisher(Base, BaseMixin):
|
||||
__tablename__ = 'bookshelf_publisher'
|
||||
name = Column(String, unique=True)
|
||||
books = relationship("Book")
|
||||
books = relationship("Book", back_populates="publisher")
|
||||
|
||||
def import_dict(self, import_data: Dict[str, Any]):
|
||||
self.id = import_data['id']
|
||||
+1
-1
@@ -4,7 +4,7 @@ from typing import Dict, List, Optional, Any
|
||||
from sqlalchemy import Column, ForeignKey, Integer, String, Boolean, func
|
||||
from sqlalchemy.orm import relationship, Mapped, mapped_column
|
||||
|
||||
from db.models.base import Base, BaseMixin
|
||||
from kontor_model.db.models.base import Base, BaseMixin
|
||||
|
||||
|
||||
class Publisher(Base):
|
||||
+36
-53
@@ -1,14 +1,8 @@
|
||||
import re
|
||||
import subprocess
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
from sqlalchemy import Boolean, Column, String, ForeignKey
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from db.models.base import Base, BaseMixin, BaseVideoMixin
|
||||
from kontor_model.db.models.base import Base, BaseMixin, BaseVideoMixin
|
||||
|
||||
|
||||
class MediaFile(Base, BaseMixin, BaseVideoMixin):
|
||||
@@ -21,6 +15,9 @@ class MediaFile(Base, BaseMixin, BaseVideoMixin):
|
||||
def __str__(self):
|
||||
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']
|
||||
@@ -49,52 +46,6 @@ class MediaFile(Base, BaseMixin, BaseVideoMixin):
|
||||
item['should_download'] = self.should_download
|
||||
return item
|
||||
|
||||
def update_title(self) -> None:
|
||||
print(f"update title for {self.url}")
|
||||
try:
|
||||
r = requests.get(self.url)
|
||||
soup = BeautifulSoup(r.content, "html.parser")
|
||||
title_tag = soup.find('title')
|
||||
if title_tag:
|
||||
self.title = title_tag.get_text()
|
||||
self.review = False
|
||||
except:
|
||||
self.title = None
|
||||
self.review = True
|
||||
self.last_modified_date = datetime.now()
|
||||
|
||||
def download_file(self, download_dir: str, dl_tool: str):
|
||||
print(f"download file for {self.url} to {download_dir}")
|
||||
result = subprocess.run([dl_tool, self.url], cwd=download_dir, capture_output=True, text=True)
|
||||
if result.returncode == 0:
|
||||
output = result.stdout
|
||||
output = re.sub(' +', ' ', output)
|
||||
lines_list = output.splitlines()
|
||||
file_name = self.__parse_output__(lines_list)
|
||||
if file_name is None:
|
||||
self.review = True
|
||||
self.should_download = True
|
||||
self.file_name = None
|
||||
else:
|
||||
download_file = Path(file_name)
|
||||
self.should_download = False
|
||||
self.file_name = download_file.name
|
||||
self.cloud_link = str(download_file.absolute())
|
||||
self.last_modified_date = datetime.now()
|
||||
|
||||
def __parse_output__(self, lines_list):
|
||||
self.file_name = None
|
||||
for line in lines_list:
|
||||
if 'has already been downloaded' in line:
|
||||
end_len = len(' has already been downloaded')
|
||||
self.file_name = line[11:-end_len]
|
||||
if 'Destination' in line:
|
||||
line_len = len(line)
|
||||
start_len = len('[download] Destination: ')
|
||||
file_len = line_len - start_len
|
||||
self.file_name = line[-file_len:]
|
||||
return self.file_name
|
||||
|
||||
|
||||
class MediaActor(Base, BaseMixin):
|
||||
__tablename__ = 'media_actor'
|
||||
@@ -222,3 +173,35 @@ class MediaVideo(Base, BaseMixin):
|
||||
item['url'] = self.url
|
||||
item['should_download'] = self.should_download
|
||||
return item
|
||||
|
||||
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
|
||||
@@ -2,7 +2,7 @@ from typing import Dict, Any
|
||||
from sqlalchemy import Column, Integer, String, ForeignKey, UniqueConstraint, Boolean
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from db.models.base import Base, BaseMixin
|
||||
from kontor_model.db.models.base import Base, BaseMixin
|
||||
|
||||
|
||||
class Sport(Base, BaseMixin):
|
||||
+1
-1
@@ -2,7 +2,7 @@ from typing import Optional
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from src.db.models.admin import Profile
|
||||
from kontor_model.db.models.admin import Profile
|
||||
|
||||
|
||||
def get_profile_by_username(username: str, db: Session) -> Optional[Profile]:
|
||||
+16
-9
@@ -1,14 +1,12 @@
|
||||
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
|
||||
from src.schema.comics.comic import ComicResponse
|
||||
from src.schema.comics.worktype import WorktypeResponse
|
||||
from kontor_model.db.models.comic import Artist
|
||||
from kontor_model.schema.comics.artist import AddArtist
|
||||
from kontor_model.schema.comics.artist_details import ArtistDetailResponse, ArtistWorktypeComicResponse, ArtistWorktypeIssueResponse
|
||||
from kontor_model.schema.comics.comic import ComicResponse
|
||||
from kontor_model.schema.comics.worktype import WorktypeResponse
|
||||
|
||||
|
||||
def get_artist_details(artist: Artist) -> ArtistDetailResponse:
|
||||
@@ -17,7 +15,17 @@ 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, title=work.comic.title, completed=work.comic.completed)
|
||||
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_works_map[worktype_id].comics.append(comic)
|
||||
else:
|
||||
comic_works_map[worktype_id] = ArtistWorktypeComicResponse(
|
||||
@@ -37,7 +45,6 @@ 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
|
||||
+9
-12
@@ -2,16 +2,15 @@ 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
|
||||
from src.schema.comics.comic_details import ComicDetailsResponse, ComicWorktypeArtistResponse
|
||||
from src.schema.comics.issue import IssueResponse, issue_to_response
|
||||
from src.schema.comics.issue_details import IssueDetailsResponse
|
||||
from src.schema.comics.publisher import publisher_to_response
|
||||
from src.schema.comics.volume import VolumeResponse, volume_to_response
|
||||
from src.schema.comics.worktype import worktype_to_response
|
||||
from kontor_model.db.models.comic import Comic, Issue
|
||||
from kontor_model.schema.comics.artist import artist_to_response
|
||||
from kontor_model.schema.comics.comic import ComicSchema, comic_to_response
|
||||
from kontor_model.schema.comics.comic_details import ComicDetailsResponse, ComicWorktypeArtistResponse
|
||||
from kontor_model.schema.comics.issue import IssueResponse, issue_to_response
|
||||
from kontor_model.schema.comics.issue_details import IssueDetailsResponse
|
||||
from kontor_model.schema.comics.publisher import publisher_to_response
|
||||
from kontor_model.schema.comics.volume import VolumeResponse, volume_to_response
|
||||
from kontor_model.schema.comics.worktype import worktype_to_response
|
||||
|
||||
|
||||
def get_issue_details(issue: Issue) -> IssueDetailsResponse:
|
||||
@@ -30,7 +29,6 @@ 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
|
||||
|
||||
@@ -48,7 +46,6 @@ 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(
|
||||
@@ -0,0 +1,52 @@
|
||||
from typing import List
|
||||
|
||||
from kontor_model.db.models.comic import Publisher
|
||||
from kontor_model.schema.comics.comic import ComicResponse
|
||||
from kontor_model.schema.comics.publisher import PublisherResponse
|
||||
from kontor_model.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)
|
||||
)
|
||||
)
|
||||
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
|
||||
)
|
||||
)
|
||||
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)
|
||||
)
|
||||
response: PublisherDetailsResponse = PublisherDetailsResponse(
|
||||
id=publisher.id, name=str(publisher.name), parent_publisher=parent_publisher, imprints=imprints, comics=comics
|
||||
)
|
||||
return response
|
||||
+2
-5
@@ -4,9 +4,8 @@ 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
|
||||
from kontor_model.db.models.comic import WorkType
|
||||
from kontor_model.schema.comics.worktype import AddWorkType
|
||||
|
||||
|
||||
def create_new_worktype(work: AddWorkType, db: Session) -> WorkType:
|
||||
@@ -18,12 +17,10 @@ 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
|
||||
+7
-8
@@ -3,14 +3,13 @@ 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
|
||||
from kontor_model.db.models.media import MediaActor
|
||||
from kontor_model.db.repository.media.actorfile import delete_mediaactorfile
|
||||
from kontor_model.schema.media.actor import MediaActorModel
|
||||
|
||||
|
||||
def create_new_mediaactor(new_actor: MediaActorModel, db: Session) -> MediaActor:
|
||||
logger.info(f"create MediaActor with url {new_actor.url}")
|
||||
print(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:
|
||||
@@ -22,11 +21,11 @@ def create_new_mediaactor(new_actor: MediaActorModel, db: Session) -> MediaActor
|
||||
db.add(media_actor)
|
||||
db.commit()
|
||||
db.refresh(media_actor)
|
||||
logger.info(f"created {media_actor}")
|
||||
print(f"created {media_actor}")
|
||||
return media_actor
|
||||
|
||||
def delete_mediaactor(db: Session, actor_id: str):
|
||||
logger.info(f"delete MediaActor with id {actor_id}")
|
||||
print(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
|
||||
@@ -40,7 +39,7 @@ def import_mediaactor(db: Session, new_actor: MediaActorModel) -> MediaActor:
|
||||
"""
|
||||
import MediaFile and set missing values with default ones.
|
||||
"""
|
||||
logger.info("import MediaActor with %s", new_actor)
|
||||
print("import MediaActor with %s", new_actor)
|
||||
media_actor: MediaActor = MediaActor()
|
||||
media_actor.id = new_actor.id
|
||||
if new_actor.created_date:
|
||||
+20
-6
@@ -3,9 +3,8 @@ 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
|
||||
from kontor_model.db.models.media import MediaActorFile
|
||||
from kontor_model.schema.media.actorfile import MediaActorFileModel
|
||||
|
||||
|
||||
def create_new_mediaactorfile(
|
||||
@@ -14,7 +13,7 @@ def create_new_mediaactorfile(
|
||||
"""
|
||||
Create relation for MediaFile and MediaActor
|
||||
"""
|
||||
logger.info("create MediaActorFile with actor %s and file %s", actor_id, file_id)
|
||||
print("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()
|
||||
@@ -32,7 +31,7 @@ def delete_mediaactorfile(db: Session, actorfile_id: str):
|
||||
"""
|
||||
Delete relation between MediaFile and MediaActor.
|
||||
"""
|
||||
logger.info("delete MediaActorFile with id %s", actorfile_id)
|
||||
print("delete MediaActorFile with id %s", actorfile_id)
|
||||
media_actorfile = db.get(MediaActorFile, actorfile_id)
|
||||
db.delete(media_actorfile)
|
||||
db.commit()
|
||||
@@ -44,6 +43,21 @@ def import_mediaactorfile(
|
||||
"""
|
||||
Import MediaFile and set missing values with default ones.
|
||||
"""
|
||||
logger.info("import MediaActorFile with %s", new_actorfile)
|
||||
print("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
|
||||
+6
-7
@@ -3,16 +3,15 @@ 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
|
||||
from kontor_model.db.models.media import MediaFile
|
||||
from kontor_model.schema.media.file import MediaFileModel
|
||||
|
||||
|
||||
def create_new_mediafile(link: str, db: Session) -> MediaFile:
|
||||
"""
|
||||
Create MediaFile with gievne URL.
|
||||
"""
|
||||
logger.info("create MediaFile with url {link}")
|
||||
print("create MediaFile with url {link}")
|
||||
media_file: MediaFile = MediaFile()
|
||||
media_file.id = str(uuid.uuid4())
|
||||
media_file.url = link
|
||||
@@ -24,7 +23,7 @@ def create_new_mediafile(link: str, db: Session) -> MediaFile:
|
||||
db.add(media_file)
|
||||
db.commit()
|
||||
db.refresh(media_file)
|
||||
logger.info("created %s", media_file)
|
||||
print("created %s", media_file)
|
||||
return media_file
|
||||
|
||||
|
||||
@@ -32,7 +31,7 @@ def delete_mediafile(db: Session, media_file_id: str):
|
||||
"""
|
||||
Delete MediaFile with given ID from db.
|
||||
"""
|
||||
logger.info("delete MediaFile with id %s", media_file_id)
|
||||
print("delete MediaFile with id %s", media_file_id)
|
||||
media_file = db.get(MediaFile, media_file_id)
|
||||
db.delete(media_file)
|
||||
db.commit()
|
||||
@@ -42,7 +41,7 @@ def import_mediafile(db: Session, new_file: MediaFileModel) -> MediaFile:
|
||||
"""
|
||||
import MediaActor and set missing values with defautl ones.
|
||||
"""
|
||||
logger.info("import MediaFile with %s", new_file)
|
||||
print("import MediaFile with %s", new_file)
|
||||
media_file: MediaFile = MediaFile()
|
||||
media_file.id = new_file.id
|
||||
if new_file.created_date:
|
||||
@@ -0,0 +1,69 @@
|
||||
from datetime import datetime
|
||||
import uuid
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from kontor_model.db.models.media import MediaLofi
|
||||
from kontor_model.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
-5
@@ -3,15 +3,14 @@ import uuid
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from src.db.models.media import MediaVideo
|
||||
from src.webapps.media.forms import AddLinkForm
|
||||
from kontor_model.db.models.media import MediaVideo
|
||||
|
||||
|
||||
def create_new_video(video: AddLinkForm, db: Session) -> MediaVideo:
|
||||
print(video.url)
|
||||
def create_new_video(url: str, db: Session) -> MediaVideo:
|
||||
print(url)
|
||||
media_video = MediaVideo()
|
||||
media_video.id = str(uuid.uuid4())
|
||||
media_video.url = str(video.url)
|
||||
media_video.url = url
|
||||
media_video.created_date = datetime.now()
|
||||
media_video.last_modified_date = datetime.now()
|
||||
media_video.review = True
|
||||
@@ -0,0 +1,41 @@
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
import uuid
|
||||
from kontor_model.db.models.admin import Assignment, Profile
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from kontor_model.schema.user.profile import ProfileModel
|
||||
|
||||
|
||||
def create_new_profile(new_profile: ProfileModel, db: Session) -> Profile:
|
||||
print(f"create Profile with username {new_profile.username}")
|
||||
profile: Profile = Profile()
|
||||
profile.id = str(uuid.uuid4())
|
||||
profile.user_name = new_profile.username
|
||||
profile.first_name = new_profile.first_name
|
||||
profile.last_name = new_profile.last_name
|
||||
profile.created_date = datetime.now()
|
||||
profile.last_modified_date = datetime.now()
|
||||
profile.version = 0
|
||||
db.add(profile)
|
||||
db.commit()
|
||||
db.refresh(profile)
|
||||
print(f"created {profile}")
|
||||
return profile
|
||||
|
||||
def delete_profile(db: Session, profile_id: str):
|
||||
print(f"delete Profile with id {profile_id}")
|
||||
profile: Optional[Profile] = db.get(Profile, profile_id)
|
||||
if profile is not None:
|
||||
assignments = profile.assignments
|
||||
for assignment in assignments:
|
||||
delete_assignment(db, assignment.id)
|
||||
db.delete(profile)
|
||||
db.commit()
|
||||
|
||||
def delete_assignment(db: Session, assignment_id: str) -> None:
|
||||
print(f"delete Assignment with id {assignment_id}")
|
||||
assignment: Optional[Assignment] = db.get(Assignment, assignment_id)
|
||||
if assignment is not None:
|
||||
db.delete(assignment)
|
||||
db.commit()
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user