-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
NetBox version
v3.2.3
Python version
3.9
Steps to Reproduce
- Start with a clean, empty installation
- Create a custom script
testscript.py:
from extras.scripts import * from dcim.models import Device class MultiObjectVarTest(Script): devices = MultiObjectVar (model=Device) def run(data, commit): pass
- Create a dummy
ManufacturerandDeviceType - Fill the database with multiple
Deviceobjects (more than 10) - Confirm that devices have at least picked up PKs 1 thru 10
- Access
http://netbox/extras/scripts/testscript.MultiObjectVarTest/?devices=1(1 is a valid, existing device pk) -> Confirm that thedevicesfield is properly populated with theDevicewhich has pk 1 - Access
http://netbox/extras/scripts/testscript.MultiObjectVarTest/?devices=10(10 is also a valid, existing device pk) -> Notice that thedevicesfield is now empty
Expected Behavior
Access http://netbox/extras/scripts/testscript.MultiObjectVarTest/?devices=10 (10 is a valid, existing device pk) and confirm that the devices field is properly populated with the Device which has pk 10
Observed Behavior
The devices field is not populated with the Device which has PK 10, but can be searched manually.
I believe that this is due to the widget only prefetching the first few items and not knowing what to do with higher-count objects.
Metadata
Metadata
Assignees
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application