"day":fields.String, "gmt":fields.String, "hour":fields.String, "latitude":fields.Float, "live":fields.Integer, "longitude":fields.Float, "shape":fields.String, "shape_detail":fields.Nested(spot_shape_detail), "shape_full":fields.String, "size":fields.Integer, "size_ft":fields.Float, "spot_id":fields.Integer, "spot_name":fields.String, "warnings":fields.List(fields.String), } spot_resource_fields = resource_field_generator.gen_resource_field(spot_spit_cast_response_data) regional_data_detail_tide = { "date":fields.String, "day":fields.String, "gmt":fields.String, "hour":fields.String, "name":fields.String, "tide":fields.Float, "tide_meters":fields.Float, } regional_data_detail_wide = { "date":fields.String, "day":fields.String, "direction_degrees":fields.Integer,
type=str, required = True, location='args', help='The location of the city in California', ) # Resource Field definition nearby_location_spit_cast_response_data = { "coordinates":fields.List(fields.Float), "county_id":fields.Integer, "progress":fields.Integer, "spot_id":fields.Integer, "spot_id_char":fields.String, "spot_name":fields.String, } nearby_location_resource_fields = resource_field_generator.gen_resource_field(nearby_location_spit_cast_response_data) nearby_location_resource_fields['location'] = fields.String # Restful Service Class class nearby_location(Resource): @marshal_with(nearby_location_resource_fields) def get(self): args = post_parser.parse_args() places_nearme_object = places_nearme(args.location) nearby_location_response = places_nearme_object.sorted_spot_based_on_distance() nearby_location_response['location'] = args.location return nearby_location_response