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

Asset Tag field requires exact match in filtering #2166

Closed
lampwins opened this issue Jun 14, 2018 · 1 comment · Fixed by #2167
Closed

Asset Tag field requires exact match in filtering #2166

lampwins opened this issue Jun 14, 2018 · 1 comment · Fixed by #2167
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@lampwins
Copy link
Contributor

Issue type

[ x ] Feature request
[ ] Bug report
[ ] Documentation

Environment

  • Python version: 3.5
  • NetBox version: 2.3.3

Description

The asset_tag field on the Device model does not allow for partial string matching with filtering. This causes annoyances related to inconsistency because other fields like name and serial number support partial matching. While an asset tag is generally unique, for longer tag IDs, operators commonly wish to strip the first part of the tag which is not unique when searching.

I would like to see the asset_tag field use the icontains filter in the DeviceFilter
https://github.com/digitalocean/netbox/blob/develop/netbox/dcim/filters.py#L512

@jeremystretch jeremystretch added the status: under review Further discussion is needed to determine this issue's scope and/or implementation label Jun 14, 2018
lampwins added a commit to lampwins/netbox that referenced this issue Jun 14, 2018
@jeremystretch
Copy link
Member

Just to clarify, this will enable partial matching of the asset_tag field in search only (e.g. ?q=ABC123). Filtering directly on the asset_tag field (e.g. ?asset_tag=ABC123) will still require an exact match.

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Jul 18, 2018
jeremystretch added a commit that referenced this issue Jul 18, 2018
implements #2166 - asset tag partial string search
@lock lock bot locked as resolved and limited conversation to collaborators Jan 17, 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

Successfully merging a pull request may close this issue.

2 participants