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

Filtering by content type should support specifying app and model name #4897

Closed
jeremystretch opened this issue Jul 24, 2020 · 0 comments
Closed
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Milestone

Comments

@jeremystretch
Copy link
Member

Environment

  • Python version: 3.6.9
  • NetBox version: 2.8.8

Proposed Functionality

Support filtering on ContentType foreign key fields by the model's human-friendly label in addition to its numeric ID. For example, both of the following should return the same results:

GET /api/extras/object-changes/?changed_object_type=dcim.Device
GET /api/extras/object-changes/?changed_object_type_id=48  # Or whatever the correct ID is for the type

This was originally raised under #4431 for ObjectChanges, however there are several instances in NetBox where this change is needed, including:

  • dcim.Cable
  • extras.ImageAttachment
  • extras.ObjectChange
  • ipam.IPAddress (v2.9+)
  • users.ObjectPermission (v2.9+)

Use Case

Allows a user to filter by related object type without needing to first look up the type's unique ID.

Database Changes

None

External Dependencies

None

@jeremystretch jeremystretch added the type: feature Introduction of new functionality to the application label Jul 24, 2020
@jeremystretch jeremystretch self-assigned this Jul 24, 2020
@jeremystretch jeremystretch added the status: accepted This issue has been accepted for implementation label Jul 24, 2020
@jeremystretch jeremystretch added this to the v2.10 milestone Aug 21, 2020
@jeremystretch jeremystretch removed their assignment Aug 21, 2020
@jeremystretch jeremystretch self-assigned this Sep 22, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 22, 2020
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: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

1 participant