Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
teknikattan-scoring-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tddd96-grupp1
teknikattan-scoring-system
Merge requests
!80
Resolve "Dashboard api calls"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Dashboard api calls"
110-dashboard-api-calls
into
dev
Overview
0
Commits
6
Pipelines
4
Changes
1
Merged
Carl Schönfelder
requested to merge
110-dashboard-api-calls
into
dev
4 years ago
Overview
0
Commits
6
Pipelines
4
Changes
1
Expand
Closes
#110 (closed)
0
0
Merge request reports
Viewing commit
de716e9d
Prev
Next
Show latest version
1 file
+
0
−
21
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
de716e9d
fix: file changes
· de716e9d
robban64
authored
4 years ago
server/app/apis/statistics.py deleted
100644 → 0
+
0
−
21
Options
import
app.core.http_codes
as
codes
import
app.database.controller
as
dbc
from
app.apis
import
check_jwt
,
item_response
,
list_response
from
app.core.dto
import
UserDTO
from
app.core.parsers
import
user_parser
,
user_search_parser
from
app.database.models
import
City
,
Competition
,
User
from
flask
import
request
from
flask_jwt_extended
import
get_jwt_identity
,
jwt_required
from
flask_restx
import
Namespace
,
Resource
api
=
Namespace
(
"
statistics
"
)
@api.route
(
"
/
"
)
class
Statistics
(
Resource
):
@check_jwt
(
editor
=
True
)
def
get
(
self
):
user_count
=
User
.
query
.
count
()
competition_count
=
Competition
.
query
.
count
()
region_count
=
City
.
query
.
count
()
return
{
"
users
"
:
user_count
,
"
competitions
"
:
competition_count
,
"
regions
"
:
region_count
},
codes
.
OK
Loading