Description
NetBox version
v3.76
Feature type
Change to existing functionality
Proposed functionality
Today it appears that the “/extras/scripts/” view is sorted based on core_managedfile’s data_synced field. I would like to see the order_by be defined or want to add a new setting to the configuration to allow for us to set a static way for the screen to render.
Hardcode this line
Line 1220 in 4b21cf6
script_modules = ScriptModule.objects.restrict(request.user).order_by("data_path")
Or allow for a config setting like below:
script_modules = ScriptModule.objects.restrict(request.user)
ORDERING_CHOICES = ["data_path","file_path"]
sort = getattr(settings,"SCRIPT_VIEW_SORT",None)
if sort in ORDERING_CHOICES:
script_modules = script_modules.order_by(sort_field)
return render(request, 'extras/script_list.html', {
Hardcoding the .order_by("data_path")
fixes the issue on my local box no matter how files are added or updated to the script page
Use case
Our end users complain that the script groups jump all over the page as we add or update script in Netbox. This forces them to have to scroll up and down the page till they are able to find the group of script they wish to run
Database changes
This is a GUI change and no database changes are expected
External dependencies
n/a