You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The NautobotUIViewSets make things a lot simpler when developing apps but one thing that would make it even easier would be to have the object_retrieve.html template display a table of developer defined fields to eliminate some extra templating work needed for the plugin.
I find myself creating a lot of very simple and repeated retrieve.html templates that are just generating a table of fields in the model. It would be nice to not have to create these templates just to add in a block for the content_left_page to display a simple table.
The general idea is that developers could use a variable (retrieve_fields in the example below) in the model class similar to the csv_headers variable. Then, the generic/object_retrieve.html template would check to see if the object has retreive_fields defined and if so, display the table.
This is just an example I borrowed from the nautobot-plugin-bgp-models app to show what I'd like to see
classAutonomousSystem(PrimaryModel, StatusModel):
# [...stripped for brevity...]retrieve_fields= ["asn", "description", "status", "provider"]
The following table gets displayed in via the generic object_retrieve.html template:
type: featureIntroduction of substantial new functionality to the application
1 participant
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The NautobotUIViewSets make things a lot simpler when developing apps but one thing that would make it even easier would be to have the object_retrieve.html template display a table of developer defined fields to eliminate some extra templating work needed for the plugin.
I find myself creating a lot of very simple and repeated retrieve.html templates that are just generating a table of fields in the model. It would be nice to not have to create these templates just to add in a block for the content_left_page to display a simple table.
The general idea is that developers could use a variable (
retrieve_fields
in the example below) in the model class similar to the csv_headers variable. Then, the generic/object_retrieve.html template would check to see if the object has retreive_fields defined and if so, display the table.This is just an example I borrowed from the nautobot-plugin-bgp-models app to show what I'd like to see
The following table gets displayed in via the generic object_retrieve.html template:
Beta Was this translation helpful? Give feedback.
All reactions