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
Commits
3838b1ab
Commit
3838b1ab
authored
3 years ago
by
Josef Olsson
Browse files
Options
Downloads
Patches
Plain Diff
Add documentation for dbc.edit
parent
5c128f38
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/app/database/controller/edit.py
+16
-0
16 additions, 0 deletions
server/app/database/controller/edit.py
with
16 additions
and
0 deletions
server/app/database/controller/edit.py
+
16
−
0
View file @
3838b1ab
"""
This file contains functionality to get data from the database.
"""
from
app.core
import
db
def
switch_order
(
item1
,
item2
):
"""
Switches order between two slides.
"""
old_order
=
item1
.
order
new_order
=
item2
.
order
...
...
@@ -21,6 +27,8 @@ def switch_order(item1, item2):
def
component
(
item
,
x
,
y
,
w
,
h
,
data
):
"""
Edits position, size and content of the provided component.
"""
if
x
:
item
.
x
=
x
if
y
:
...
...
@@ -38,6 +46,8 @@ def component(item, x, y, w, h, data):
def
slide
(
item
,
title
=
None
,
timer
=
None
):
"""
Edits the title and timer of the slide.
"""
if
title
:
item
.
title
=
title
if
timer
:
...
...
@@ -49,6 +59,8 @@ def slide(item, title=None, timer=None):
def
team
(
item_team
,
name
=
None
,
competition_id
=
None
):
"""
Edits the name and competition of the team.
"""
if
name
:
item_team
.
name
=
name
if
competition_id
:
...
...
@@ -60,6 +72,8 @@ def team(item_team, name=None, competition_id=None):
def
competition
(
item
,
name
=
None
,
year
=
None
,
city_id
=
None
):
"""
Edits the name and year of the competition.
"""
if
name
:
item
.
name
=
name
if
year
:
...
...
@@ -73,6 +87,7 @@ def competition(item, name=None, year=None, city_id=None):
def
user
(
item
,
name
=
None
,
email
=
None
,
city_id
=
None
,
role_id
=
None
):
"""
Edits the name, email, city and role of the user.
"""
if
name
:
item
.
name
=
name
.
title
()
...
...
@@ -92,6 +107,7 @@ def user(item, name=None, email=None, city_id=None, role_id=None):
def
question
(
item_question
,
name
=
None
,
total_score
=
None
,
type_id
=
None
,
slide_id
=
None
):
"""
Edits the name, score, type and slide of the question.
"""
if
name
:
item_question
.
name
=
name
...
...
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