mirror of
https://github.com/Kludex/awesome-fastapi-projects.git
synced 2024-11-27 22:11:08 +00:00
39 lines
788 B
Python
39 lines
788 B
Python
|
"""Module contains the models for the application."""
|
||
|
|
||
|
from pydantic import BaseModel, ConfigDict, NonNegativeInt
|
||
|
|
||
|
from app.types import DependencyId, RepoId, RevisionHash
|
||
|
|
||
|
|
||
|
class DependencyCreateData(BaseModel):
|
||
|
"""A dependency of a repository."""
|
||
|
|
||
|
name: str
|
||
|
|
||
|
|
||
|
class DependencyDetail(BaseModel):
|
||
|
"""A dependency of a repository."""
|
||
|
|
||
|
model_config = ConfigDict(
|
||
|
from_attributes=True,
|
||
|
)
|
||
|
|
||
|
id: DependencyId
|
||
|
name: str
|
||
|
|
||
|
|
||
|
class RepoDetail(BaseModel):
|
||
|
"""A repository that is being tracked."""
|
||
|
|
||
|
model_config = ConfigDict(
|
||
|
from_attributes=True,
|
||
|
)
|
||
|
|
||
|
id: RepoId
|
||
|
url: str
|
||
|
description: str
|
||
|
stars: NonNegativeInt
|
||
|
source_graph_repo_id: int
|
||
|
dependencies: list[DependencyDetail]
|
||
|
last_checked_revision: RevisionHash | None
|