Closes #21929: Eliminate redundant object view templates#21930
Closes #21929: Eliminate redundant object view templates#21930jeremystretch wants to merge 5 commits intofeaturefrom
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
@claude /review Highlight any inconsistencies or gaps |
|
Claude finished @jeremystretch's task in 7m 6s —— View job Code Review: Eliminate Redundant Object View Templates
OverviewThis PR deletes "empty" model-specific templates that only contained Bug:
|
|
Fixed the above bug concerning ObjectChildrenView |
There was a problem hiding this comment.
Can we remove all the assignments of template_name = 'generic/object.html' and just put it into netbox.views.generic.object_views.ObjectView it should still work the same and would be consistent with the other Generic object views and less boilerplate with the new get_default_template
Also the doc comment on netbox.views.generic.object_views.ObjectView needs to be changed, currently
Note: If `template_name` is not specified, it will be determined automatically based on the queryset model.
With the new logic the is reversed, it will always try to check if the {app}/{model} template exists first and then fallback to the template_name.
|
@arthanson That would potentially break plugin usage. We'll probably head that way eventually, but for now we have to be very careful not to alter the base view's behavior. |
Closes: #21929
get_default_template()utility function to safely resolve the conventional template name for a modelget_default_template()generic/object.htmldirectly