mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-07 08:23:12 -05:00
* 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
42 lines
696 B
Python
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
|