예제 #1
0
        """
        try:
            well = Well.objects.get(well_tag_number=well_id)
        except Well.DoesNotExist:
            raise Http404("Well not found")

        return Response(get_well_history(well))


WELL_PROPERTIES = openapi.Schema(
    type=openapi.TYPE_OBJECT,
    title='GeoJSON Feature properties.',
    description='See: https://tools.ietf.org/html/rfc7946#section-3.2',
    properties={
        'well_tag_number':
        get_model_feature_schema(Well, 'well_tag_number'),
        'identification_plate_number':
        get_model_feature_schema(Well, 'identification_plate_number'),
        'well_status':
        get_model_feature_schema(WellStatusCode, 'description'),
        'licence_status':
        get_model_feature_schema(LicencedStatusCode, 'description'),
        'detail':
        openapi.Schema(
            type=openapi.TYPE_STRING,
            max_length=255,
            title='Detail',
            description=
            ('Link to well summary report within the Groundwater Wells and Aquifer (GWELLS)'
             ' application. The well summary provides the overall desription and history of the'
             ' well.')),
예제 #2
0
        return Response(status=status.HTTP_200_OK)

    def delete(self, request, aquifer_id, **kwargs):
        aquifer = Aquifer.objects.get(pk=aquifer_id)
        del aquifer.geom
        aquifer.save()
        return Response(status=status.HTTP_204_NO_CONTENT)


AQUIFER_PROPERTIES = openapi.Schema(
    type=openapi.TYPE_OBJECT,
    title='GeoJSON Feature properties.',
    description='See: https://tools.ietf.org/html/rfc7946#section-3.2',
    properties={
        'aquifer_id':
        get_model_feature_schema(Aquifer, 'aquifer_id'),
        'name':
        get_model_feature_schema(Aquifer, 'aquifer_name'),
        'location':
        get_model_feature_schema(Aquifer, 'location_description'),
        'detail':
        openapi.Schema(
            type=openapi.TYPE_STRING,
            max_length=255,
            title='Detail',
            description=
            ('Link to aquifer summary report within the Groundwater Wells and Aquifer (GWELLS)'
             ' application. The aquifer summary provides the overall desription and history of the'
             ' aquifer.')),
        'material':
        get_model_feature_schema(AquiferMaterial, 'description'),