Sorting the changelog list by object causes exception #7330

Closed
opened 2025-12-29 20:22:00 +01:00 by adam · 6 comments
Owner

Originally created by @mlvgn on GitHub (Dec 7, 2022).

Originally assigned to: @kkthxbye-code on GitHub.

NetBox version

v3.3.9

Python version

3.10

Steps to Reproduce

  1. Make one change of an object to ensure there is a list
  2. Go to the changelog
  3. Click the object header
  4. Refresh the page

Expected Behavior

List with changes

Observed Behavior

<class 'django.core.exceptions.FieldError'>

Field 'changed_object' does not generate an automatic reverse relation and therefore cannot be used for reverse querying. If it is a GenericForeignKey, consider adding a GenericRelation.

Python version: 3.10.6
NetBox version: 3.3.9

Originally created by @mlvgn on GitHub (Dec 7, 2022). Originally assigned to: @kkthxbye-code on GitHub. ### NetBox version v3.3.9 ### Python version 3.10 ### Steps to Reproduce 1. Make one change of an object to ensure there is a list 2. Go to the changelog 3. Click the object header 4. Refresh the page ### Expected Behavior List with changes ### Observed Behavior <class 'django.core.exceptions.FieldError'> Field 'changed_object' does not generate an automatic reverse relation and therefore cannot be used for reverse querying. If it is a GenericForeignKey, consider adding a GenericRelation. Python version: 3.10.6 NetBox version: 3.3.9
adam added the type: bugstatus: accepted labels 2025-12-29 20:22:00 +01:00
adam closed this issue 2025-12-29 20:22:00 +01:00
Author
Owner

@arthanson commented on GitHub (Dec 7, 2022):

Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.

@arthanson commented on GitHub (Dec 7, 2022): Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.
Author
Owner

@mlvgn commented on GitHub (Dec 7, 2022):

Hello arthanson!

Thanks for your reply. Unfortunately, I can't find what could be causing this error. I worked with NetBox as usual, adding and removing devices and changing devices. At one point, when I wanted to see the Change Log, I got this error. Before that everything worked.

@mlvgn commented on GitHub (Dec 7, 2022): Hello arthanson! Thanks for your reply. Unfortunately, I can't find what could be causing this error. I worked with NetBox as usual, adding and removing devices and changing devices. At one point, when I wanted to see the Change Log, I got this error. Before that everything worked.
Author
Owner

@jeremystretch commented on GitHub (Dec 7, 2022):

@mlvgn are you able to provide a complete stack trace? (You can enable this by temporarily setting DEBUG = True in configuration.py and restarting NetBox.)

@jeremystretch commented on GitHub (Dec 7, 2022): @mlvgn are you able to provide a complete stack trace? (You can enable this by temporarily setting `DEBUG = True` in `configuration.py` and restarting NetBox.)
Author
Owner

@mlvgn commented on GitHub (Dec 7, 2022):

Hello, jeremystretch!

I solved this problem:

  1. Opened my user preferences
  2. Moved to Table Configurations
  3. Clicked the checkmark next to ObjectChangeTable (ordering: object_repr)
  4. Saved
@mlvgn commented on GitHub (Dec 7, 2022): Hello, [jeremystretch](https://github.com/jeremystretch)! I solved this problem: 1. Opened my user preferences 2. Moved to Table Configurations 3. Clicked the checkmark next to ObjectChangeTable (ordering: object_repr) 4. Saved
Author
Owner

@kkthxbye-code commented on GitHub (Dec 7, 2022):

I replicated what causes it and updated the steps in the post.

The object column is sortable, but it will throw an exception when trying to sort by object_repr. Maybe the object column should just not be sortable? @jeremystretch?

@kkthxbye-code commented on GitHub (Dec 7, 2022): I replicated what causes it and updated the steps in the post. The object column is sortable, but it will throw an exception when trying to sort by object_repr. Maybe the object column should just not be sortable? @jeremystretch?
Author
Owner

@jeremystretch commented on GitHub (Dec 7, 2022):

Maybe the object column should just not be sortable?

That seems like the correct approach IMO.

@jeremystretch commented on GitHub (Dec 7, 2022): > Maybe the object column should just not be sortable? That seems like the correct approach IMO.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7330