Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
ViaResto-website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aymeric Chaumont
ViaResto-website
Merge requests
!47
Exceptional closure
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Exceptional closure
exceptional_closure
into
main
Overview
0
Commits
4
Pipelines
6
Changes
1
Merged
Exceptional closure
Antoine Gaudron-Desjardins
requested to merge
exceptional_closure
into
main
Jul 20, 2022
Overview
0
Commits
4
Pipelines
6
Changes
1
0
0
Merge request reports
Viewing commit
b399eabb
Prev
Next
Show latest version
1 file
+
11
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
b399eabb
add id in returned closure so we can could delete it from the admin interface
· b399eabb
Antoine Gaudron-Desjardins
authored
Jul 20, 2022
backend/db/schemas.py
+
11
−
2
View file @ b399eabb
Edit in single-file editor
Open in Web IDE
Show full file
@@ -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
Closure
Base
(
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
Loading