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
Commits
d6b9d774
Commit
d6b9d774
authored
Jul 12, 2022
by
Antoine Gaudron-Desjardins
Browse files
Options
Downloads
Patches
Plain Diff
linting
parent
672122a0
No related branches found
No related tags found
1 merge request
!28
improve front
Pipeline
#43979
passed with warnings
Jul 12, 2022
Stage: build
Stage: test
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
backend/main.py
+5
-7
5 additions, 7 deletions
backend/main.py
with
5 additions
and
7 deletions
backend/main.py
+
5
−
7
View file @
d6b9d774
...
...
@@ -2,6 +2,11 @@ from fastapi import FastAPI
from
fastapi.middleware.cors
import
CORSMiddleware
from
dotenv
import
load_dotenv
import
os
from
db.database
import
get_db
from
fastapi
import
Depends
from
sqlalchemy.orm
import
Session
from
db
import
schemas
from
typing
import
List
from
db
import
database
,
models
from
routers
import
stats
,
comments
,
news
...
...
@@ -36,13 +41,6 @@ app.include_router(comments.router)
app
.
include_router
(
news
.
router
)
from
db.database
import
get_db
from
fastapi
import
Depends
from
sqlalchemy.orm
import
Session
from
db
import
schemas
from
typing
import
List
@app.get
(
'
/api/records
'
,
response_model
=
List
[
schemas
.
Record
])
async
def
get_records
(
place
:
str
,
db
:
Session
=
Depends
(
get_db
)):
return
db
.
query
(
models
.
Records
).
filter
(
models
.
Records
==
place
).
order_by
(
models
.
Records
.
date
.
desc
()).
all
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment