Skip to content

Drop backward compatibility for specifying queryset on custom script ObjectVar, MultiObjectVar #5995

@jeremystretch

Description

@jeremystretch

Proposed Changes

Drop backward compatibility for the queryset keyword argument for custom script ObjectVar and MultiObjectVar field types. These fields should be initialized using the model keyword instead. For example,

device1 = ObjectVar(
    queryset=Device.objects.all()
)

becomes:

device1 = ObjectVar(
    model=Device
)

Justification

NetBox currently issues a warning when initializing these fields with queryset, and its use is deprecated. The model parameter was introduced to eliminate confusion regarding filter of available options (which should be done using the query_params parameter).

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: deprecationRemoval of existing functionality or behavior

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions