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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user