Skip to content
Discussion options

You must be logged in to vote

The reason dns_zone fails is that the plugin doesn't register a URL per custom object type — there's no dns_zone view. All custom objects are served by a single generic view named customobject, so {% url 'plugins:netbox_custom_objects:dns_zone' ... %} can never reverse (hence Reverse for 'dns_zone' not found).

Simplest: use get_absolute_url

Custom objects implement it, so you don't need {% url %} at all:

<a href="{{ object.get_absolute_url }}">{{ object.name }}</a>

That's the same pattern NetBox core uses, and it's the most robust because the plugin owns the reverse logic. From the model (netbox_custom_objects/models.py):

def get_absolute_url(self):
    return reverse(
        "plugins:ne…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@markkuleinio
Comment options

Answer selected by markkuleinio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants