Compare commits
No commits in common. "29b9dd9b844fdfa34621b441c1ee0ea3b1b07fa5" and "6b164aa9830f1f3d14a6da731abe9b4c4c7f0943" have entirely different histories.
29b9dd9b84
...
6b164aa983
8 changed files with 11 additions and 47 deletions
BIN
backend/dev.db
BIN
backend/dev.db
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
[tool.pyrefly]
|
||||
|
||||
project-includes = [
|
||||
"./**/*.py",
|
||||
"./**/**/*.py",
|
||||
]
|
||||
|
|
@ -1,17 +1,3 @@
|
|||
from sqlmodel import Relationship
|
||||
from ..models.user import User
|
||||
from sqlmodel import DateTime
|
||||
from sqlmodel import Field
|
||||
from sqlmodel import UUID
|
||||
from sqlmodel import SQLModel
|
||||
|
||||
class CommentBase(SQLModel):
|
||||
pass
|
||||
# Comment: id, slug, content, datetime, foreign key: user
|
||||
|
||||
class Comment(CommentBase, table=True):
|
||||
id: UUID | None = Field(default=None, primary_key=True)
|
||||
slug: str = Field(index=True)
|
||||
content: str = Field()
|
||||
date_time: DateTime = Field(default=DateTime())
|
||||
user_id: UUID = Field(foreign_key="user.id")
|
||||
user: User = Relationship(back_populates="comments")
|
||||
|
|
@ -3,3 +3,6 @@
|
|||
|
||||
#Reference: https://isaacfei.com/posts/simple-like-system/
|
||||
|
||||
# addReaction
|
||||
# delete Reaction
|
||||
# get Reactions by slug
|
||||
|
|
@ -1,17 +1,8 @@
|
|||
from unicodedata import name
|
||||
from sqlmodel import Field
|
||||
from sqlmodel import UUID
|
||||
from sqlmodel import Relationship
|
||||
from ..models.comment import Comment
|
||||
from sqlmodel import SQLModel
|
||||
|
||||
class UserBase(SQLModel):
|
||||
pass
|
||||
# User: id, email(unique), name(unique), usercode(f.e. WLAID, unique) , subscription(bool), active=false
|
||||
|
||||
class User(UserBase):
|
||||
id: UUID | None = Field(default=None, primary_key=True)
|
||||
email: str = Field(unique=True)
|
||||
name: str = Field(unique=True)
|
||||
user_code: str = Field(unique=True) # TODO: create generation function
|
||||
subscription: bool = Field()
|
||||
comments: list[Comment] = Relationship(back_populates="user")
|
||||
# CreateUser <- mail, Name
|
||||
# Login Rate Limit! -> token for everything else
|
||||
# Forgot Code <- token, email
|
||||
# Delete User <- token
|
||||
# change mail <- token, mail
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
|
||||
# add comment
|
||||
# delete comment
|
||||
# get comments
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
|
||||
|
||||
# addReaction
|
||||
# delete Reaction
|
||||
# get Reactions by slug
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# CreateUser <- mail, Name
|
||||
# Login Rate Limit! -> token for everything else
|
||||
# Forgot Code <- email (rate limit)
|
||||
# Delete User <- token
|
||||
# change mail <- token, new mail
|
||||
|
||||
# delete all deactivated users after 48h
|
||||
Loading…
Add table
Reference in a new issue