Changelog ObjectType does not populate with q filter #5262

Closed
opened 2025-12-29 19:26:01 +01:00 by adam · 5 comments
Owner

Originally created by @sdktr on GitHub (Aug 31, 2021).

Originally assigned to: @DanSheps on GitHub.

NetBox version

v3.0.0

Python version

3.8

Steps to Reproduce

  1. Open the filter tab of: https://demo.netbox.dev/extras/changelog/
  2. Click 'object type filter'
  3. Enter search query: ipam

Expected Behavior

Result of the dropdown is filtered to IPAM types
image

Observed Behavior

No results are displayed. The workaround is to first manually scroll down untill the list is fully populated. After that it can be searched through.
image

Originally created by @sdktr on GitHub (Aug 31, 2021). Originally assigned to: @DanSheps on GitHub. ### NetBox version v3.0.0 ### Python version 3.8 ### Steps to Reproduce 1. Open the filter tab of: https://demo.netbox.dev/extras/changelog/ 2. Click 'object type filter' 3. Enter search query: ipam ### Expected Behavior Result of the dropdown is filtered to IPAM types ![image](https://user-images.githubusercontent.com/19833687/131489887-1cc8eeba-5e97-4900-a55e-9855c3d240b7.png) ### Observed Behavior No results are displayed. The workaround is to first manually scroll down untill the list is fully populated. After that it can be searched through. ![image](https://user-images.githubusercontent.com/19833687/131489719-6d3ce3f9-5d78-4cbc-8095-4edf19beb6d9.png)
adam added the type: bugstatus: accepted labels 2025-12-29 19:26:01 +01:00
adam closed this issue 2025-12-29 19:26:01 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 31, 2021):

This is a general issue with API-backed select fields it seems. I thought we had fixed this recently, but I've confirmed it remains an issue. The selection list does automatically expand when the user reaches the end, however searching for an option that has not yet been loaded is broken.

Disregard this; I wasn't quite paying attention while testing earlier. Seems this may just be a changelog bug.

@jeremystretch commented on GitHub (Aug 31, 2021): ~This is a general issue with API-backed select fields it seems. I thought we had fixed this recently, but I've confirmed it remains an issue. The selection list _does_ automatically expand when the user reaches the end, however searching for an option that has not yet been loaded is broken.~ Disregard this; I wasn't quite paying attention while testing earlier. Seems this may just be a changelog bug.
Author
Owner

@DanSheps commented on GitHub (Aug 31, 2021):

This actually looks like the changelog endpoint is not properly filtering using the q filter.

/api/extras/content-types/?brief=true&q=ipam

Returns all entries

@DanSheps commented on GitHub (Aug 31, 2021): This actually looks like the changelog endpoint is not properly filtering using the q filter. /api/extras/content-types/?brief=true&q=ipam Returns all entries
Author
Owner

@DanSheps commented on GitHub (Aug 31, 2021):

  q = django_filters.CharFilter(
        method='search',
        label='Search',
    )

    def search(self, queryset, name, value):
        if not value.strip():
            return queryset
        return queryset.filter(
            Q(app_label__icontains=value || model__icontains=value)
        )

Will probably fix this, will do some testing

@DanSheps commented on GitHub (Aug 31, 2021): ``` q = django_filters.CharFilter( method='search', label='Search', ) def search(self, queryset, name, value): if not value.strip(): return queryset return queryset.filter( Q(app_label__icontains=value || model__icontains=value) ) ``` Will probably fix this, will do some testing
Author
Owner

@thatmattlove commented on GitHub (Aug 31, 2021):

That may be part of it, but not all of it. There's also an issue with how APISelect is handling pagination, so a similar issue occurs when the user reaches the bottom of a list.

@thatmattlove commented on GitHub (Aug 31, 2021): That may be part of it, but not all of it. There's also an issue with how APISelect is handling pagination, so a similar issue occurs when the user reaches the bottom of a list.
Author
Owner

@DanSheps commented on GitHub (Aug 31, 2021):

I would say this one is specific to changelog though.

I think that one is #7081, I will add you onto that one. Gonna take this one as I already have the filter fix.

@DanSheps commented on GitHub (Aug 31, 2021): I would say this one is specific to changelog though. I think that one is #7081, I will add you onto that one. Gonna take this one as I already have the filter fix.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5262