Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AUTO-soa-lab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Eckl, Máté
AUTO-soa-lab
Commits
e79e5376
Commit
e79e5376
authored
Apr 6, 2017
by
dnsadmin
Browse files
Options
Downloads
Patches
Plain Diff
4. Feladat - DELETE és POST javítás
parent
c0ec94c9
Branches
master
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
service.py
+5
-4
5 additions, 4 deletions
service.py
with
5 additions
and
4 deletions
service.py
+
5
−
4
View file @
e79e5376
...
@@ -186,7 +186,7 @@ def __insert_vehicle(form):
...
@@ -186,7 +186,7 @@ def __insert_vehicle(form):
usz
=
form
[
"
ulesek
"
],
usz
=
form
[
"
ulesek
"
],
lk
=
form
[
"
legkondi
"
]
lk
=
form
[
"
legkondi
"
]
)
)
return
{
"
New id
"
:
nextid
}
return
{
"
jarmu_kulcs
"
:
nextid
}
except
KeyError
:
except
KeyError
:
return
{
"
Error
"
:
"
Field is missing
"
}
return
{
"
Error
"
:
"
Field is missing
"
}
finally
:
finally
:
...
@@ -196,8 +196,9 @@ def __insert_vehicle(form):
...
@@ -196,8 +196,9 @@ def __insert_vehicle(form):
@app.route
(
"
/jarmuvek.json
"
,
methods
=
[
"
POST
"
])
@app.route
(
"
/jarmuvek.json
"
,
methods
=
[
"
POST
"
])
def
insert_vehicle
():
def
insert_vehicle
():
logging
.
debug
(
request
.
form
)
logging
.
debug
(
"
content-type:
"
+
str
(
request
.
headers
.
get
(
'
Content-Type
'
)
==
'
application/json
'
)
)
return
jsonify
(
__insert_vehicle
(
request
.
form
))
logging
.
debug
(
request
.
get_json
(
silent
=
True
,
force
=
True
))
return
jsonify
(
__insert_vehicle
(
request
.
get_json
(
silent
=
True
,
force
=
True
)))
def
__get_nevnap
(
date
):
def
__get_nevnap
(
date
):
try
:
try
:
...
@@ -281,7 +282,7 @@ def __delete_vehicle(jarmu_kulcs):
...
@@ -281,7 +282,7 @@ def __delete_vehicle(jarmu_kulcs):
finally
:
finally
:
conn
.
close
()
conn
.
close
()
@app.route
(
'
/jarmuvek/<jarmu_kulcs>
.json
'
,
methods
=
[
"
DELETE
"
])
@app.route
(
'
/jarmuvek/<jarmu_kulcs>
'
,
methods
=
[
"
DELETE
"
])
def
delete_vehicle
(
jarmu_kulcs
):
def
delete_vehicle
(
jarmu_kulcs
):
if
(
__delete_vehicle
(
jarmu_kulcs
)
==
0
):
if
(
__delete_vehicle
(
jarmu_kulcs
)
==
0
):
abort
(
404
)
abort
(
404
)
...
...
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