1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #10608: Register all core model views using register_model_view()

This commit is contained in:
jeremystretch
2022-10-07 17:17:58 -04:00
parent a3dbf4023c
commit b0ba9bd83d
16 changed files with 389 additions and 344 deletions

View File

@ -32,8 +32,10 @@ def get_model_urls(app_label, model_name):
view_ = view_.as_view()
# Create a path to the view
name = f"{model_name}_{config['name']}" if config['name'] else model_name
url_path = f"{config['path']}/" if config['path'] else ''
paths.append(
path(f"{config['path']}/", view_, name=f"{model_name}_{config['name']}", kwargs=config['kwargs'])
path(url_path, view_, name=name, kwargs=config['kwargs'])
)
return paths