items-models-import-error
This commit is contained in:
parent
d3f3b01dbf
commit
7854eec2f7
5 changed files with 94 additions and 32 deletions
|
|
@ -1,12 +1,12 @@
|
|||
from fastapi import HTTPException
|
||||
from sqlalchemy import Column, Integer, String, Float, Boolean, ForeignKey
|
||||
from sqlalchemy.dialects.postgresql import ARRAY
|
||||
from sqlalchemy.orm import Session
|
||||
from sqlalchemy.orm import Session, relationship
|
||||
from ..config import Base
|
||||
|
||||
|
||||
|
||||
|
||||
'''
|
||||
##### veri tabanı modelleri #####
|
||||
class Collections(Base):
|
||||
__tablename__ = "collections_table"
|
||||
|
|
@ -15,4 +15,9 @@ class Collections(Base):
|
|||
user_id = Column(Integer, ForeignKey('users_table.user_id'), nullable=False)
|
||||
visibility = Column(Boolean, default=True)
|
||||
colllection_name = Column(String, default="No name")
|
||||
collection_description = Column(String, default="No description")
|
||||
collection_description = Column(String, default="No description")
|
||||
|
||||
# ilişkiler
|
||||
user = relationship("DBUser", back_populates="user_collections")
|
||||
items = relationship("Items", back_populates="collection", cascade="all, delete-orphan")
|
||||
'''
|
||||
Loading…
Add table
Add a link
Reference in a new issue