def post(self): args = parser.parse_args() name = args.get('name') location = args.get('location') if name is None or location is None: abort(400, message='Bad request data') lat = location['lat'] lon = location['lon'] record = Business() record.name = name record.location = { "type": "Point", "coordinates": [lon, lat] } record.save() return record, 201