Skip to content

Custom field objects sort by ID rather than what they display #10721

@neuro42

Description

@neuro42

NetBox version

v3.3.6

Python version

3.9

Steps to Reproduce

  1. Add a custom field
    1. Model: IPAM > prefix
    2. Name: gateway
    3. Type: object
    4. Object type: IPAM > IP address
  2. Add some IP addresses (being out of sorted order)
    1. 172.16.42.1/24
    2. 172.16.10.1/24
    3. 172.16.128.1/24
    4. 172.16.6.1/24
  3. Add some prefixes, using the added IP address objects for the custom gateway field
    1. 172.16.42.0/24 w/ 172.16.42.1/24
    2. 172.16.10.0/24 w/ 172.16.10.1/24
    3. 172.16.128.0/24 w/ 172.16.128.1/24
    4. 172.16.6.0/24 w/ 172.16.6.1/24
  4. View the prefix list, and configure the table to include the custom gateway field
  5. click on the gateway column header to sort by the custom field

Expected Behavior

Gateway column to be in sorted IP address order:
172.16.6.1/24
172.16.10.1/24
172.16.42.1/24
172.16.128.1/24

Observed Behavior

Gateway column is sorted by object id (creation order):
172.16.42.1/24
172.16.10.1/24
172.16.128.1/24
172.16.6.1/24

Non-custom columns (eg: site) are sorted by their name, and not their ID

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions