mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-25 08:09:41 +02:00
* additional server events * sort 'recent recipes' by updated * remove duplicate code * fixes #396 * set color * consolidate tag/category pages * set colors * list unorganized recipes * cleanup old code * remove flash message, switch to global snackbar * cancel to close * cleanup * notifications first pass * test notification * complete notification feature * use background tasks * add url param * update documentation Co-authored-by: hay-kot <hay-kot@pm.me>
37 lines
732 B
Python
37 lines
732 B
Python
from datetime import datetime
|
|
from enum import Enum
|
|
from typing import Optional
|
|
|
|
from fastapi_camelcase import CamelModel
|
|
from pydantic import Field
|
|
|
|
|
|
class EventCategory(str, Enum):
|
|
general = "general"
|
|
recipe = "recipe"
|
|
backup = "backup"
|
|
scheduled = "scheduled"
|
|
migration = "migration"
|
|
group = "group"
|
|
user = "user"
|
|
|
|
|
|
class Event(CamelModel):
|
|
id: Optional[int]
|
|
title: str
|
|
text: str
|
|
time_stamp: datetime = Field(default_factory=datetime.now)
|
|
category: EventCategory = EventCategory.general
|
|
|
|
class Config:
|
|
orm_mode = True
|
|
|
|
|
|
class EventsOut(CamelModel):
|
|
total: int
|
|
events: list[Event]
|
|
|
|
|
|
class TestEvent(CamelModel):
|
|
id: Optional[int]
|
|
test_url: Optional[str]
|