Skip to content

Conversation

@pheus
Copy link
Contributor

@pheus pheus commented Oct 15, 2025

Fixes: #20554

Summary
Switch ipam.Service filtering to use ContentTypeFilter for parent_object_type and apply the same approach anywhere we expose a generic relation via filters (e.g., object_type, related_object_type, assigned_object_type). This lets GET filters accept the documented <app>.<model> form (e.g., virtualization.virtualmachine) and aligns GET with POST and existing usability across the app.

What changed

  • Replaced integer-based validation with ContentTypeFilter for parent_object_type in the Services filterset.
  • Standardized on ContentTypeFilter for similar parameters across filtersets where applicable.
  • Added/updated tests to cover filtering via <app>.<model> for the affected params.

Why
Fixes the “Value must be an integer” error when filtering Services by parent_object_type and brings behavior in line with how generic relations are documented and used elsewhere. No database or schema changes.

Introduce `ContentTypeFilter` across several filtersets, including
`object_type`, `related_object_type`, `assigned_object_type`, and
`parent_object_type`. This improvement enhances filtering specificity
and aligns with existing usability standards.

Closes netbox-community#20554
@jeremystretch jeremystretch requested review from a team and bctiemann and removed request for a team October 15, 2025 16:48
@pheus pheus changed the title Fixes #20554: Add ContentTypeFilter several filtersets Fixes #20554: Add ContentTypeFilter to several filtersets Oct 15, 2025
@bctiemann bctiemann merged commit 389c44e into netbox-community:main Oct 15, 2025
7 checks passed
@pheus pheus deleted the 20554-add-missing-contenttypefilter-to-filtersets branch October 15, 2025 18:20
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.

ipam/services: GET parent_object_type - wrong data type - integer

2 participants