Skip to content
Snippets Groups Projects
Commit b399eabb authored by Antoine Gaudron-Desjardins's avatar Antoine Gaudron-Desjardins
Browse files

add id in returned closure so we can could delete it from the admin interface

parent 76a58fcb
Branches
No related tags found
1 merge request!47Exceptional closure
Pipeline #44400 passed with warnings
......@@ -68,6 +68,7 @@ class NewsBase(BaseModel):
class News(NewsBase):
"""Database news base schema"""
id: int
published_at: datetime = Field(..., title="Publication date of the news")
class Config:
......@@ -99,13 +100,21 @@ class OpeningHours(OpeningHoursBase):
orm_mode = True
class Closure(BaseModel):
""" Closure schema """
class ClosureBase(BaseModel):
""" Closure schema base """
place: str = Field(..., title="Name of the restaurant")
beginning_date: datetime = Field(..., title="Beginning date of closure")
end_date: datetime = Field(..., title="Ending date of closure")
class Closure(ClosureBase):
""" Closure schema """
id: int
class Config:
orm_mode = True
class Restaurant(BaseModel):
"""Restaurant schema for reading"""
name: str
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment