FieldError when trying so sort on Account count field in Providers list #10819

Closed
opened 2025-12-29 21:36:17 +01:00 by adam · 0 comments
Owner

Originally created by @jnovinger on GitHub (Feb 27, 2025).

Originally assigned to: @jnovinger on GitHub.

First discussed in discussion #17020 circuits/provider Error

Deployment Type

Self-hosted

NetBox Version

v4.2.4

Python Version

3.10

Steps to Reproduce

  1. Create one or more Providers (/circuits/providers/add/)
  2. Navigate to Providers list (http://127.0.0.1:8000/circuits/providers/)
  3. Click 'Account count' column in order to sort providers by number of associate accounts

Expected Behavior

List of providers should be sorted based on how many provider accounts are associated with each.

Observed Behavior

FieldError is raised

Image

  File "~/.virtualenvs/netbox/lib/python3.10/site-packages/django/db/models/sql/query.py", line 1423, in try_transform
    raise FieldError(

Exception Type: FieldError at /circuits/providers/
Exception Value: Unsupported lookup 'count' for BigAutoField or join on the field not permitted, perhaps you meant contains?
Originally created by @jnovinger on GitHub (Feb 27, 2025). Originally assigned to: @jnovinger on GitHub. First discussed in discussion [#17020 circuits/provider Error](https://github.com/netbox-community/netbox/discussions/17020) ### Deployment Type Self-hosted ### NetBox Version v4.2.4 ### Python Version 3.10 ### Steps to Reproduce 1. Create one or more Providers (`/circuits/providers/add/`) 2. Navigate to Providers list (`http://127.0.0.1:8000/circuits/providers/`) 3. Click 'Account count' column in order to sort providers by number of associate accounts ### Expected Behavior List of providers should be sorted based on how many provider accounts are associated with each. ### Observed Behavior `FieldError` is raised ![Image](https://github.com/user-attachments/assets/d4898a32-f38c-42ee-a876-54d7f96629fc) ``` File "~/.virtualenvs/netbox/lib/python3.10/site-packages/django/db/models/sql/query.py", line 1423, in try_transform raise FieldError( Exception Type: FieldError at /circuits/providers/ Exception Value: Unsupported lookup 'count' for BigAutoField or join on the field not permitted, perhaps you meant contains? ```
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:36:17 +01:00
adam closed this issue 2025-12-29 21:36:17 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10819