Adds search for the remaining tables. Closes #118.
Other changes include:
DB migration for LocalAsset model to accommodate for when the asset_id is a charfield instead of an integer. This is required because the PicnicGroves fpd_id is a charfield.
Another DB migration for LocalAsset model to allow null and blank asset_id fields. This field was meant to save the fpd_uid but in testing this PR, I found an edge case where sometimes that field is null.
Also had to create a NullableCharField in the BaseLocalAssetSerializer so we could save this field.
The discovery of this edge case led to a discovery of improper 400 error handling when submitting a post request via ajax, so I added better error handling for that.
Added a popup to the asset geometries in the map.
For the ParkingLots model, changed the table to search the "acer"."parking_lots_union_mv" and changed the fields to match that materialized view.
Notes
This searches all of the tables that we've discussed with Garret. If we need to fine tune the columns we search, it will be as simple as adding the desired columns to @hancush's clever Search subclass solution. That subclass works in unison with the AssetViewSet'sget_queryset` method.
login with the ccfp-asset-dashboard test user credentials in lastpass
go to the asset map tool
search and save these types of assets:
Points of Interest
Picnic Groves
Parking Lots
Signage
you can test the NullableCharField in the BaseLocalAssetSerializer by searching those asset types with the text "red". that search should return some assets where that field null. you should be able to save the assets when they have a identifier field.
Overview
Adds search for the remaining tables. Closes #118.
Other changes include:
LocalAsset
model to accommodate for when theasset_id
is a charfield instead of an integer. This is required because thePicnicGroves
fpd_id is a charfield.LocalAsset
model to allow null and blankasset_id
fields. This field was meant to save thefpd_uid
but in testing this PR, I found an edge case where sometimes that field is null.NullableCharField
in theBaseLocalAssetSerializer
so we could save this field.ParkingLots
model, changed the table to search the"acer"."parking_lots_union_mv"
and changed the fields to match that materialized view.Notes
This searches all of the tables that we've discussed with Garret. If we need to fine tune the columns we search, it will be as simple as adding the desired columns to @hancush's clever
Search
subclass solution. That subclass works in unison with theAssetViewSet's
get_queryset` method.Testing Instructions
ccfp-asset-dashboard test user
credentials in lastpassBaseLocalAssetSerializer
by searching those asset types with the text "red". that search should return some assets where that field null. you should be able to save the assets when they have a identifier field.