POST zum Laufen gebracht.. RTFM! :-)
This commit is contained in:
parent
d0a77b3f0f
commit
20f38fff91
@ -20,16 +20,22 @@ def GetTimes():
|
|||||||
def PostTimes():
|
def PostTimes():
|
||||||
|
|
||||||
schema = model.Times()
|
schema = model.Times()
|
||||||
|
print (request.is_json)
|
||||||
|
content = request.get_json(force=True)
|
||||||
|
print (content)
|
||||||
|
# body = parser.parse(schema, request, location='json')
|
||||||
|
|
||||||
body = parser.parse(schema, request, location='json')
|
return impl.times.PostTimes(content)
|
||||||
|
|
||||||
return impl.times.PostTimes(body)
|
|
||||||
|
|
||||||
|
|
||||||
@bp.route('/times', methods=['put'])
|
@bp.route('/times', methods=['put'])
|
||||||
def PutTimes():
|
def PutTimes():
|
||||||
|
|
||||||
schema = model.Times()
|
schema = model.Times()
|
||||||
|
print (request.is_json)
|
||||||
|
content = request.get_json()
|
||||||
|
print (content)
|
||||||
|
|
||||||
|
|
||||||
body = parser.parse(schema, request, location='json')
|
body = parser.parse(schema, request, location='json')
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,18 @@ def PostTimes(body):
|
|||||||
|
|
||||||
# This creates a *new* entry
|
# This creates a *new* entry
|
||||||
|
|
||||||
return 400
|
# TODO: Validate the upload data
|
||||||
|
|
||||||
|
try:
|
||||||
|
commands = pydapper.using(local_db.connection_pool)
|
||||||
|
|
||||||
|
except Exception as ex:
|
||||||
|
logging.error(ex)
|
||||||
|
print(ex)
|
||||||
|
return json.dumps("call failed"), 500
|
||||||
|
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
def PutTimes(body):
|
def PutTimes(body):
|
||||||
|
|||||||
@ -77,6 +77,10 @@ class ParticipantList(Participant):
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Shipcall(Schema):
|
class Shipcall(Schema):
|
||||||
|
def __init__(self):
|
||||||
|
many = True
|
||||||
|
pass
|
||||||
|
|
||||||
id: int
|
id: int
|
||||||
ship_id: int
|
ship_id: int
|
||||||
type: int
|
type: int
|
||||||
@ -127,6 +131,10 @@ class ShipcallId(Schema):
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Times(Schema):
|
class Times(Schema):
|
||||||
|
def __init__(self):
|
||||||
|
many = True
|
||||||
|
pass
|
||||||
|
|
||||||
id: int
|
id: int
|
||||||
start_planned: datetime
|
start_planned: datetime
|
||||||
end_planned: datetime
|
end_planned: datetime
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user