mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-08-26 16:40:40 +03:00
remove directive with no parameters
This commit is contained in:
parent
d0372e4420
commit
92249e1b8b
@ -1,4 +1,5 @@
|
||||
import uuid
|
||||
from typing import Optional
|
||||
|
||||
from fastapi import HTTPException, status
|
||||
from sqlalchemy import String, select
|
||||
@ -13,8 +14,10 @@ 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)
|
||||
name: Mapped[str] = mapped_column(String, nullable=False, primary_key=True, unique=True)
|
||||
description: Mapped[str] = mapped_column(String, nullable=False)
|
||||
name: Mapped[str] = mapped_column(String, primary_key=True, unique=True)
|
||||
description: Mapped[Optional[str]]
|
||||
# TODO: apply relation to other tables
|
||||
|
||||
|
||||
@classmethod
|
||||
async def find(cls, db_session: AsyncSession, name: str):
|
||||
|
@ -11,7 +11,7 @@ from sqlalchemy import (
|
||||
select,
|
||||
)
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from sqlalchemy.orm import relationship, mapped_column, Mapped
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from app.models.base import Base
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
import uuid
|
||||
from typing import Optional
|
||||
|
||||
from fastapi import HTTPException, status
|
||||
from sqlalchemy import String, select
|
||||
@ -13,8 +14,8 @@ class Stuff(Base):
|
||||
__tablename__ = "stuff"
|
||||
__table_args__ = ({"schema": "happy_hog"},)
|
||||
id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), unique=True, default=uuid.uuid4, autoincrement=True)
|
||||
name: Mapped[str] = mapped_column(String, nullable=False, primary_key=True, unique=True)
|
||||
description: Mapped[str] = mapped_column(String, nullable=False)
|
||||
name: Mapped[str] = mapped_column(String, primary_key=True, unique=True)
|
||||
description: Mapped[Optional[str]]
|
||||
|
||||
@classmethod
|
||||
async def find(cls, db_session: AsyncSession, name: str):
|
||||
|
Loading…
x
Reference in New Issue
Block a user