Files
mealie/mealie/schema/recipe/recipe_comments.py
Hayden ea7c4771ee Feature/user photo storage (#877)
* add default assets for user profile

* add recipe avatar

* change user_id to UUID

* add profile image upload

* setup image cache keys

* cleanup tests and add image tests

* purge user data on delete

* new user repository tests

* add user_id validator for int -> UUID conversion

* delete depreciated route

* force set content type

* refactor tests to use temp directory

* validate parent exists before createing

* set user_id to correct type

* update instruction id

* reset primary key on migration
2021-12-18 19:04:36 -09:00

42 lines
696 B
Python

from datetime import datetime
from typing import Optional
from uuid import UUID
from fastapi_camelcase import CamelModel
from pydantic import UUID4
class UserBase(CamelModel):
id: int
username: Optional[str]
admin: bool
class Config:
orm_mode = True
class RecipeCommentCreate(CamelModel):
recipe_id: int
text: str
class RecipeCommentSave(RecipeCommentCreate):
user_id: UUID4
class RecipeCommentUpdate(CamelModel):
id: UUID
text: str
class RecipeCommentOut(RecipeCommentCreate):
id: UUID
recipe_id: int
created_at: datetime
update_at: datetime
user_id: UUID4
user: UserBase
class Config:
orm_mode = True