Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,26 @@ PLUGINS_CONFIG = {
}
```

## Related Object Tabs

When a Custom Object Type has fields referencing other NetBox objects (e.g., a "Firewall Rules" type with a Device field), a **Combined "Custom Objects" tab** automatically appears on the detail pages of those referenced objects, showing all linked custom objects.

You can also enable **dedicated typed tabs** for specific Custom Object Types by adding their slugs to `PLUGINS_CONFIG`:

```python
PLUGINS_CONFIG = {
'netbox_custom_objects': {
'typed_tab_slugs': [
'firewall-rules',
'security-audits',
],
},
}
```

> [!NOTE]
> After adding or removing slugs from `typed_tab_slugs`, a NetBox restart is required for the changes to take effect. The combined tab is always active and requires no configuration.

## Known Limitations

NetBox Custom Objects is now Generally Available which means you can use it in production and migrations to future versions will work. There are many upcoming features including GraphQL support - the best place to see what's on the way is the [issues](https://github.com/netboxlabs/netbox-custom-objects/issues) list on the GitHub repository.
15 changes: 15 additions & 0 deletions netbox_custom_objects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ class CustomObjectsPluginConfig(PluginConfig):
default_settings = {
# The maximum number of Custom Object Types that may be created
'max_custom_object_types': 50,
# List of COT slugs that get dedicated typed tabs on related object detail pages.
# Requires server restart after changes.
# Example: ['firewall-rules', 'security-audits']
'typed_tab_slugs': [],
}
required_settings = []
template_extensions = "template_content.template_extensions"
Expand Down Expand Up @@ -204,8 +208,19 @@ def ready(self):
super().ready()
return

# Register related-object tabs (combined + typed)
from .tab_views import register_all_tabs
register_all_tabs()

super().ready()

# These must run AFTER super().ready() which registers journal/changelog views
# and triggers URL conf generation via register_models()
if not self.should_skip_dynamic_model_creation():
from .tab_views import inject_co_urls, deduplicate_registry
inject_co_urls()
deduplicate_registry()

def get_model(self, model_name, require_ready=True):
self.apps.check_apps_ready()
try:
Expand Down
Loading
Loading