Skip to content

Add filter by attributed for custom-object-types#437

Open
arthanson wants to merge 26 commits intomainfrom
filter-fields2
Open

Add filter by attributed for custom-object-types#437
arthanson wants to merge 26 commits intomainfrom
filter-fields2

Conversation

@arthanson
Copy link
Copy Markdown
Contributor

@arthanson arthanson commented Mar 27, 2026

Fixes: #296

From @ifoughal original PR: #365 - added tests and cleanup.

This pull request adds dynamic filtering capabilities for custom object type fields, allowing users to filter custom objects based on their field values via the API and UI.

Changes:

  • Introduced a FilterSpec dataclass and field type-to-filter mapping system in filtersets.py
  • Added ArrayContainsFilter for multiselect fields, fixing filtering on PostgreSQL ArrayField
  • Implemented get_filterform_field for Decimal, Object, and MultiObject field types
  • Fixed incorrect module name from "database.filtersets" to "netbox_custom_objects.filtersets"
  • Added test coverage for all custom field types
Monosnap Cot1 | NetBox 2026-04-16 16-15-13 Monosnap Cot1s | NetBox 2026-04-16 16-15-29

Also needed to add new CustomObjectAPITestCaseMixin as previously was using NetBox APIViewTestCases.APIViewTestCase which plugins shouldn't do - this was causing errors from NetBox recent test changes.

@netboxlabs netboxlabs deleted a comment from claude Bot Apr 16, 2026
@arthanson arthanson marked this pull request as ready for review April 16, 2026 23:38
@arthanson arthanson requested a review from bctiemann April 16, 2026 23:40
@arthanson arthanson changed the title Filter fields2 Add filter by attributed for custom-object-types Apr 20, 2026
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 24, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add filter by attributed for custom-object-types

4 participants