Exemple #1
0
def new_location():
    jsonData = simplejson.loads(request.body.read()) if request.body else {}
    newLocationID = False
    if jsonData:
        from Location import Location
        LocationObj = Location(db)
        newLocationID = LocationObj.create_new_location(jsonData)
    if newLocationID:
        return api_response(locationID=newLocationID)
    else:
        return api_error(message="Something went wrong, we'll figure it out")