netbox-custom-objects 0.6.0 compatibility (2.5.0) - #17
Merged
Conversation
added 4 commits
August 24, 2026 09:08
…ox-custom-objects 0.6.0
The template override was based on 0.5.x and silently dropped upstream
0.6.0 features on the CO detail page: Contacts tab, Config Context tab,
owner display, coordinates rendering with Map button, and the polymorphic
M2M Type column. Regenerated from 0.6.0 stock with only our two deltas
(custom_object_tab_tags load + {% plugin_extra_tabs %} between Contacts
and Journal); the file keeps upstream formatting so future refreshes are
a plain diff against new stock.
The 0.6.0-based template reverses URLs that don't exist on 0.5.x, so the
ready() probe now checks CustomObjectFieldTypeChoices.TYPE_COORDINATES
(added in 0.6.0) and points users at netbox-custom-objects>=0.6.0.
…t.html base template
Two fixes in the typed/combined view plumbing:
- Replace the local filter-form replica in typed.py with upstream's
build_filterset_form_class (netbox_custom_objects.dynamic_forms) — the
same builder CustomObjectListView uses. The replica assigned the dict
returned by polymorphic get_filterform_field() (one form field per
allowed target type) to a single attribute, so polymorphic filters
never rendered in the typed-tab sidebar. Also gains the 0.6.0 owner
filter for free.
- _get_base_template() built "{app}/{model}.html" unconditionally, but
not every model has one (ipam/vrf.html and dcim/macaddress.html don't
exist), so {% extends base_template %} raised TemplateDoesNotExist
(HTTP 500) on those models' tab pages. Delegate to NetBox's
utilities.views.get_default_template(), which falls back to
generic/object.html — the same resolution Journal/Changelog tabs use.
Affected both combined and typed tabs.
Surfaces the 0.6.0 ownership field: sortable Owner column (hideable via
Configure Table, default on), an owner dropdown next to the tag filter,
and owner in the sort keys. Rows fetch owner via select_related — no
extra queries (OwnerMixin is on the CustomObject base, so every dynamic
model has the FK).
Also fixes the Field column sort link, which rendered as literal text
due to a mismatched template brace ({{ sort_headers.field.url %}).
CHANGELOG entry, README compatibility matrix (2.5.x requires netbox-custom-objects >=0.6.0; 0.5.x installs stay on 2.4.1), and version bump.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release 2.5.0: requires netbox-custom-objects >=0.6.0 (0.5.x installs stay on 2.4.1). NetBox floors unchanged (4.5.2–4.6.99).
customobject.htmloverride from 0.6.0 stock — restores Contacts tab, Config Context tab, owner header, coordinates rendering, polymorphic M2M Type column. Only two deltas from stock; upstream formatting kept so future refreshes are a plain diff.ready()probe now keys offCustomObjectFieldTypeChoices.TYPE_COORDINATESand points atpip install -U 'netbox-custom-objects>=0.6.0'.build_filterset_form_class(also gains the owner filter).TemplateDoesNotExiston tab pages of models without a per-model detail template (ipam/vrf.html,dcim/macaddress.html) —_get_base_template()now delegates to NetBox'sget_default_template()(falls back togeneric/object.html).select_related("owner"), no extra queries).Verified: 58 unit tests pass; ruff/djlint clean; CO detail, combined tab (incl. VRF fallback), and typed tab render 200 against NetBox 4.6 with upstream 0.6.0-based code.