item-create
This commit is contained in:
parent
7c35097c88
commit
039b877241
4 changed files with 31 additions and 21 deletions
|
|
@ -12,6 +12,11 @@ from sqlalchemy import Integer, DateTime
|
|||
from sqlalchemy.orm import Session, relationship, mapped_column, Mapped
|
||||
from sqlalchemy.dialects.postgresql import ARRAY
|
||||
from email.message import EmailMessage
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..items.models import Items
|
||||
|
||||
|
||||
import jwt
|
||||
|
||||
|
|
@ -69,10 +74,9 @@ class DBUser(Base):
|
|||
created_date : Mapped[datetime] = mapped_column(DateTime, default=datetime.now()) #datetime.datetime -> python, DateTime -> sqlalchemy
|
||||
bio : Mapped[str] = mapped_column(default="No bio")
|
||||
follow_users : Mapped[list[int]] = mapped_column(ARRAY(Integer), default=[]) # takip edilen kullanıcılar
|
||||
|
||||
# -> buralar diğer tablolar ile olan ilişkiler
|
||||
from ..items.models import Items
|
||||
items : Mapped[list['Items']] = relationship("Items", back_populates="user", cascade="all, delete-orphan", lazy='select')
|
||||
items : Mapped[list['Items']] = relationship("Items", back_populates="user", cascade="all, delete-orphan")
|
||||
collections : Mapped[int] = mapped_column(default=0) # hat vermesin diye eklendi collections aktif değil
|
||||
|
||||
|
||||
|
||||
|
|
@ -128,7 +132,7 @@ async def get_current_user(
|
|||
|
||||
credentials_exception = HTTPException(
|
||||
status_code=401,
|
||||
detail="Invalid credentials",
|
||||
detail="Invalid credentials currently",
|
||||
headers={"WWW-Authenticate": "Bearer"},
|
||||
)
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue