add event
This commit is contained in:
parent
d206a9f8a3
commit
75a6802c15
43
app/models/events.py
Normal file
43
app/models/events.py
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
from pydantic import BaseModel, EmailStr
|
||||||
|
from pydantic_mongo import AbstractRepository, ObjectIdField
|
||||||
|
from datetime import datetime, date
|
||||||
|
|
||||||
|
class Event(BaseModel):
|
||||||
|
id: ObjectIdField = None
|
||||||
|
name: str
|
||||||
|
place: str
|
||||||
|
status: int = 0
|
||||||
|
participants: list[str] | None = None
|
||||||
|
organizers: list[str] | None = None
|
||||||
|
interested: list[str] | None = None
|
||||||
|
start_date: datetime | None = None
|
||||||
|
end_date: datetime | None = None
|
||||||
|
created_at: datetime = datetime.today()
|
||||||
|
updated_at: datetime | None = None
|
||||||
|
deleted_at: datetime | None = None
|
||||||
|
disabled_at: datetime | None = None
|
||||||
|
|
||||||
|
class EventOut(BaseModel):
|
||||||
|
id: ObjectIdField = None
|
||||||
|
name: str
|
||||||
|
place: str
|
||||||
|
status: int = 0
|
||||||
|
participants: list[str] | None = None
|
||||||
|
organizers: list[str] | None = None
|
||||||
|
interested: list[str] | None = None
|
||||||
|
start_date: datetime | None = None
|
||||||
|
|
||||||
|
class EventIn(BaseModel):
|
||||||
|
name: str
|
||||||
|
place: str
|
||||||
|
status: int = 0
|
||||||
|
participants: list[str] | None = None
|
||||||
|
organizers: list[str] | None = None
|
||||||
|
interested: list[str] | None = None
|
||||||
|
start_date: datetime | None = None
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class EventRepository(AbstractRepository[Event]):
|
||||||
|
class Meta:
|
||||||
|
collection_name = "events"
|
Loading…
x
Reference in New Issue
Block a user