tried to return a participant
This commit is contained in:
parent
d125a46957
commit
29419540de
@ -1,5 +1,5 @@
|
|||||||
import json
|
import json
|
||||||
|
import mariadb
|
||||||
|
|
||||||
def GetParticipant(options):
|
def GetParticipant(options):
|
||||||
"""
|
"""
|
||||||
@ -8,16 +8,26 @@ def GetParticipant(options):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Implement your business logic here
|
conn = mariadb.connect(host="localhost", user="ds", password="kle1nes")
|
||||||
# All the parameters are present in the options argument
|
|
||||||
|
|
||||||
return json.dumps({
|
cur = conn.cursor()
|
||||||
"city": "<string>",
|
|
||||||
"id": "<integer>",
|
query = "SELECT p.id, p.name, p.street, p.postal_code, p.city, p.flags FROM participant p INNER JOIN user u WHERE u.participant_id = p.id AND u.id = {id} "
|
||||||
"name": "<string>",
|
|
||||||
"postal code": "<string>",
|
cur.execute(query)
|
||||||
"street": "<string>",
|
|
||||||
}), 200
|
for (id, name, street, postal_code, city, flags) in cur:
|
||||||
|
|
||||||
|
# Implement your business logic here
|
||||||
|
# All the parameters are present in the options argument
|
||||||
|
|
||||||
|
return json.dumps({
|
||||||
|
"city": city,
|
||||||
|
"id": id,
|
||||||
|
"name": name,
|
||||||
|
"postal code": postal_code,
|
||||||
|
"street": street,
|
||||||
|
}), 200
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user