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

Wrap model detail views with register_model_view()

This commit is contained in:
jeremystretch
2022-10-07 11:36:14 -04:00
parent 4c999daacd
commit bfe26b46a6
19 changed files with 320 additions and 383 deletions

View File

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