Refactor/user database models (#775)

* fix build error

* drop frontend.old

* improve auto_init decorator

* purge depreciated site settings

* formatting

* update init function

* fix(backend): 🐛 Fix password reset bug

Co-authored-by: Hayden <hay-kot@pm.me>
This commit is contained in:
Hayden
2021-11-04 14:01:37 -08:00
committed by GitHub
parent 40462a95f1
commit ec3b53cdc3
172 changed files with 430 additions and 12255 deletions

View File

@@ -4,31 +4,7 @@ from fastapi_camelcase import CamelModel
from pydantic import validator
from slugify import slugify
from ..recipe.recipe_category import CategoryBase, RecipeCategoryResponse
class SiteSettings(CamelModel):
language: str = "en-US"
first_day_of_week: int = 0
show_recent: bool = True
cards_per_section: int = 9
categories: Optional[list[CategoryBase]] = []
class Config:
orm_mode = True
schema_extra = {
"example": {
"language": "en",
"firstDayOfWeek": 0,
"showRecent": True,
"categories": [
{"id": 1, "name": "thanksgiving", "slug": "thanksgiving"},
{"id": 2, "name": "homechef", "slug": "homechef"},
{"id": 3, "name": "potatoes", "slug": "potatoes"},
],
}
}
from ..recipe.recipe_category import RecipeCategoryResponse
class CustomPageBase(CamelModel):