Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jeremystretch opened this issue Mar 16, 2021 · 0 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: deprecation Removal of existing functionality or behavior
Milestone

Comments

@jeremystretch
Copy link
Member

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).

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: deprecation Removal of existing functionality or behavior labels Mar 16, 2021
@jeremystretch jeremystretch added this to the v2.11 milestone Mar 16, 2021
@jeremystretch jeremystretch self-assigned this Mar 16, 2021
jeremystretch added a commit that referenced this issue Mar 16, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: deprecation Removal of existing functionality or behavior
Projects
None yet
Development

No branches or pull requests

1 participant