Skip to content

Remove all limit_choices_to attributes on ForeignKey & ManyToMany fields #17166

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

Closed
jeremystretch opened this issue Aug 14, 2024 · 2 comments
Closed
Assignees
Labels
netbox status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user
Milestone

Comments

@jeremystretch
Copy link
Member

jeremystretch commented Aug 14, 2024

Proposed Changes

Remove the limit_choices_to attribute on the following model fields:

  • CircuitTermination.termination_type
  • CircuitGroupAssignment.member_type
  • CableTermination.termination_type
  • InventoryItemTemplate.component_type
  • InventoryItem.component_type
  • MACAddress.assigned_object_type
  • IPAddress.assigned_object_type
  • Prefix.scope_type
  • VLANGroup.scope_type
  • ObjectPermission.object_types
  • Cluster.scope_type
  • VirtualMachine.role
  • L2VPNTermination.assigned_object_type
  • WirelessLAN.scope_type
  • WirelessLink.interface_a
  • WirelessLink.interface_b

Justification

The limit_choices_to attribute was originally used to limit the selection of related objects for a field within a ModelForm. It is no longer needed as we explicitly declare these fields inside each ModelForm to employ dynamic selections via the REST API.

@jeremystretch jeremystretch added type: housekeeping Changes to the application which do not directly impact the end user status: backlog Awaiting selection for work labels Aug 14, 2024
@jeremystretch
Copy link
Member Author

Blocked by #10136

@jeremystretch jeremystretch added status: blocked Another issue or external requirement is preventing implementation and removed status: backlog Awaiting selection for work labels Aug 14, 2024
@jeremystretch jeremystretch added the netbox label Nov 1, 2024 — with Linear
@jeremystretch
Copy link
Member Author

This can be completed without #10136, although we should still try to complete that work.

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: blocked Another issue or external requirement is preventing implementation labels Apr 3, 2025
@jeremystretch jeremystretch self-assigned this Apr 3, 2025
@jeremystretch jeremystretch added this to the v4.3 milestone Apr 3, 2025
bctiemann added a commit that referenced this issue Apr 7, 2025
…oices_to

Closes #17166: Remove obsolete `limit_choices_to` argument from ForeignKey & M2M fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
netbox status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user
Projects
None yet
Development

No branches or pull requests

1 participant