netbox-custom-objects-tab v2.1.1
Highlights
Deferred DB queries — Typed-tab registration no longer queries the database during AppConfig.ready(), eliminating startup warnings from Django and netbox_branching.
What's Fixed
Fixed
- Deferred typed-tab initialization — DB-dependent work (typed-tab registration, CO URL injection, registry deduplication) is now deferred to the first HTTP request via Django's
request_startedsignal. This prevents:- Django warning: "Accessing the database during app initialization is discouraged"
netbox_branchingwarning: "Routing database query before branching support is initialized"
- Combined tabs continue to register immediately during
ready()(no DB access needed). - Thread-safe one-shot handler ensures deferred init runs exactly once, then disconnects itself.
Fixes #4
How It Works
register_tabs() is now two-phase:
- Phase 1 (
ready()) — registers combined tabs (factory pattern, no DB queries) - Phase 2 (first request) — a one-shot
request_startedsignal handler registers typed tabs, injects CO URL patterns, and deduplicates the view registry
Compatibility
| netbox-custom-objects-tab | NetBox | netbox_custom_objects |
|---|---|---|
| 2.1.x | 4.5.0–4.5.99 | ≥ 0.4.6 |
| 2.0.x | 4.5.0–4.5.99 | ≥ 0.4.6 |
Links
- Full Changelog: v2.1.0...v2.1.1
- PyPI: https://pypi.org/project/netbox-custom-objects-tab/