code format

This commit is contained in:
Jakub Miazek
2024-04-24 10:37:08 +02:00
parent 43fe665608
commit c2975fd260
19 changed files with 358 additions and 173 deletions

View File

@@ -12,7 +12,9 @@ from app.models.base import Base
class Nonsense(Base):
__tablename__ = "nonsense"
__table_args__ = ({"schema": "happy_hog"},)
id: Mapped[uuid:UUID] = mapped_column(UUID(as_uuid=True), unique=True, default=uuid.uuid4, autoincrement=True)
id: Mapped[uuid:UUID] = mapped_column(
UUID(as_uuid=True), unique=True, default=uuid.uuid4, autoincrement=True
)
name: Mapped[str] = mapped_column(String, primary_key=True, unique=True)
description: Mapped[str | None]
# TODO: apply relation to other tables
@@ -31,7 +33,9 @@ class Nonsense(Base):
if instance is None:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail={"Record not found": f"There is no record for requested name value : {name}"},
detail={
"Record not found": f"There is no record for requested name value : {name}"
},
)
else:
return instance