Skip to main content

NetBox plugin that adds a Custom Objects tab to object detail pages

Reason this release was yanked:

Missing MANIFEST.in

Project description

netbox-custom-objects-tab

A NetBox 4.5.x plugin that adds a Custom Objects tab to standard object detail pages, showing any Custom Object instances from the netbox_custom_objects plugin that reference those objects via OBJECT or MULTIOBJECT fields.

The tab includes pagination, text search, column sorting, type filtering, and tag filtering, with HTMX-powered partial updates so table interactions don't reload the full page.

Screenshot

Custom Objects tab showing 3 linked objects with type filter dropdown

Requirements

  • NetBox 4.5.0 – 4.5.99
  • netbox_custom_objects plugin installed and configured

Compatibility

Plugin version NetBox version
1.0.x 4.5.x

Installation

source /opt/netbox/venv/bin/activate
pip install -e /opt/custom_objects_additional_tab_plugin/

Add to NetBox configuration.py:

PLUGINS = [
    'netbox_custom_objects',
    'netbox_custom_objects_tab',
]

# Optional — defaults shown below
PLUGINS_CONFIG = {
    'netbox_custom_objects_tab': {
        'models': ['dcim.*', 'ipam.*', 'virtualization.*', 'tenancy.*', 'contacts.*'],
        'label': 'Custom Objects',
        'weight': 2000,
    }
}

Restart NetBox. No database migrations required.

Configuration

Setting Default Description
models ['dcim.*', 'ipam.*', 'virtualization.*', 'tenancy.*', 'contacts.*'] Models that get the Custom Objects tab. Accepts app_label.model_name strings or app_label.* wildcards to register every model in an app.
label 'Custom Objects' Text displayed on the tab.
weight 2000 Controls tab position in the tab bar; lower values appear further left.

Examples

# Default — all common NetBox apps
'models': ['dcim.*', 'ipam.*', 'virtualization.*', 'tenancy.*', 'contacts.*']

# Only specific models
'models': ['dcim.device', 'dcim.site', 'ipam.prefix']

# Mix wildcards and specifics
'models': ['dcim.*', 'virtualization.*', 'ipam.ipaddress']

# Third-party plugin models work identically
'models': ['dcim.*', 'ipam.*', 'inventory_monitor.*']

Third-party plugin models are fully supported — Django treats plugin apps and built-in apps the same way in the app registry. Add the plugin's app label and restart NetBox once.

The tab is hidden automatically (hide_if_empty=True) when no custom objects reference the object being viewed, so it only appears when relevant.

Features

Pagination

Results are paginated using NetBox's standard EnhancedPaginator. The page size respects the user's personal NetBox preference and can be overridden with ?per_page=N in the URL. Page controls appear at the top and bottom of the table.

Text search

A search box in the card header filters results by:

  • Custom Object instance display name
  • Custom Object Type name
  • Field label

Filtering uses the ?q= query parameter and is applied before pagination.

Type filter

A dropdown (shown when 2 or more Custom Object Types are present) lets you narrow results to a single type. Uses the ?type=<slug> query parameter. The dropdown auto-submits on selection and is populated from the types actually present in the current result set.

Tag filter

A dropdown (shown when at least one linked Custom Object has a tag) lets you narrow results to objects with a specific tag. Uses the ?tag=<slug> query parameter. The dropdown auto-submits on selection and is populated from the tags present across the full result set. Tag data is pre-fetched in bulk so there is no N+1 query cost.

Column sorting

Clicking the Type, Object, or Field column header sorts the table in-memory. A second click on the same header reverses the direction. The active column shows an up/down arrow icon. Sort state is preserved when the search form is submitted.

HTMX / Partial updates

Pagination clicks, column sort clicks, search form submissions, type-dropdown changes, and tag-dropdown changes all update the table zone in-place using HTMX — no full page reload. The URL is updated via pushState so links stay shareable and the browser back button returns to the previous filter/page state.

Value column

Each row includes a Value column showing the actual field value on the Custom Object instance:

  • Object fields: a link to the related object.
  • Multi-Object fields: comma-separated links to the related objects, truncated at 3 with an ellipsis when more are present.

Configure Table

A Configure Table button in the card header opens a NetBox modal that lets authenticated users show, hide, and reorder the table columns (Type, Object, Value, Field, Tags). Preferences are stored per-user in UserConfig and respected on every subsequent page load, including HTMX partial updates. The Actions column is always visible and cannot be hidden.

Action buttons

Each row has right-aligned action buttons, shown only when the user has the relevant permission:

  • Edit (pencil icon) — links to the Custom Object instance's edit page. Shown when the user has change permission on the object.
  • Delete (trash icon) — links to the Custom Object instance's delete confirmation page. Shown when the user has delete permission on the object.

Users without either permission see no action buttons in the row. After completing either action, NetBox redirects back to the Custom Objects tab on the same parent object.

Efficient badge counts

The tab badge (shown in the tab bar on every detail page) is computed with a COUNT(*) query per field — no object rows are fetched. Full object rows are only loaded when the tab itself is opened. This keeps detail page loads fast even when thousands of custom objects reference an object.

How It Works

When a Custom Object Type has a field of type Object or Multi-Object pointing to a NetBox model (e.g. Device), any Custom Object instances with that field set will appear in the "Custom Objects" tab on the referenced object's detail page.

The tab displays:

Column Content
Type Custom Object Type name (sortable); links to the type detail page when the user has view permission
Object Link to the Custom Object instance (sortable)
Value The value stored in the linking field — a link for Object fields, comma-separated links for Multi-Object fields
Field The field that holds the reference (sortable)
Tags Colored tag badges assigned to the Custom Object instance; when none
(actions) Edit and Delete buttons, each shown only when the user has the corresponding permission

Support

Contributing

Pull requests are welcome. For significant changes, please open an issue first.

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netbox_custom_objects_tab-1.0.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netbox_custom_objects_tab-1.0.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file netbox_custom_objects_tab-1.0.0.tar.gz.

File metadata

File hashes

Hashes for netbox_custom_objects_tab-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2e5fad994f229bc11b1c0f034f70c6de760999b091ab3eccda74873c311476f7
MD5 5da08f5e163378ca398b055f7438bf85
BLAKE2b-256 b927213030f6e032f58a5c3e026e24964f944ae663b20eee3e0c4971d29c4b9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_custom_objects_tab-1.0.0.tar.gz:

Publisher: release.yml on CESNET/netbox-custom-objects-tab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netbox_custom_objects_tab-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for netbox_custom_objects_tab-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a1875e542564bbd3a3b6503fd4f9a9810fbceab9e2914ab3a93f25e59a1042f
MD5 a14dbac16130aa84065f8bbb5ac89fe9
BLAKE2b-256 95b98875c654a06d7888f3405967ad1f3b75448f332285b5b5d00dba9b8fd5bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_custom_objects_tab-1.0.0-py3-none-any.whl:

Publisher: release.yml on CESNET/netbox-custom-objects-tab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page