During serialization, custom fields may be available to a model due to
multi-table inheritance, but might not be available in serialized data
because only direct fields of the model are covered. Now this attribute
is only used if available in serialized data. Models using multi-table
inheritance must modify their serialize_object() method to cover parent
serialization.
* Fixes#18585: filtering circuits by location
This also fixes a related issue where selected filter is not shown in
the filter form.
Changes:
- Adds `CircuitFilterSet.location_id` field to enable filtering with
incoming GET params
- Adds `CirciotFilterForm.location_id` field to enable filtering from
list form
- Adds `location_id` to the Location fieldset on `CircuitFilterForm`
* Adds test for new CircuitFilterset.location_id filter
* Fix model URL generator for plugins
* Fix reverse accessor warning
* Revert "Fix reverse accessor warning"
This reverts commit f07642bb99.
* Add URL test case for regular models
* Split dummy models
Instead of using a single model for testing, one is used for testing the
plugin API and a dedicated one is used for testing the NetBox plugin
model features.
* Fix filterset test case error
* Rename test module
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* Add racktype_count annotation to list view queryset, create the LinkedCountColumn in ManufacturerTable
* Add Manufacturer field to RackTypeFilterForm
* Setup ObjectChangeFilterForm __init__ to add query_param to filter_id
* code lint, move __init__ to end of class
* Move filter_id widget setup to SavedFiltersMixin, and add model attributes to Models FilterForms
* Add missing model declarations for filter forms
---------
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
* Changed LogLevelChoices order; Changed ScriptResultView to select LogLevelChoices to LOG_DEFAULT and setup the html template to put (All) in the last one
* Change LogLevelChoices in ScriptResultView get_table method
* Remove default option, add Default string to INFO
* Fix scripts.py and reports.py to reflect removing DEFAULT level
* fix linting