Filtering MultiObjectVar for Custom Field does not works for related object = Module Bay Template #11184

Open
opened 2025-12-29 21:41:37 +01:00 by adam · 5 comments
Owner

Originally created by @marcusyuri on GitHub (May 15, 2025).

Originally assigned to: @callumau on GitHub.

Deployment Type

NetBox Cloud

NetBox Version

v4.3.1

Python Version

3.10

Steps to Reproduce

  1. Create a new custom field with object type = DCIM -> Module Type, type = Multiple Objects and related object type = DCM -> Module Bay Template

Image

  1. Create a new module type, and press the object filtering button near the custom field

Image

Expected Behavior

A new popup widget shows allowing the user select "Manufacturer" and "Device Type", listing all filtered modules bays:

Image

This screenshot is a Microsoft Paint concept, based on another working select filter in netbox

Observed Behavior

The UI greys out and freezes

Image

Originally created by @marcusyuri on GitHub (May 15, 2025). Originally assigned to: @callumau on GitHub. ### Deployment Type NetBox Cloud ### NetBox Version v4.3.1 ### Python Version 3.10 ### Steps to Reproduce 1. Create a new custom field with object type = DCIM -> Module Type, type = Multiple Objects and related object type = DCM -> Module Bay Template ![Image](https://github.com/user-attachments/assets/abc5f42c-1bb0-4c20-8867-7db0f3565aa7) 2. Create a new module type, and press the object filtering button near the custom field ![Image](https://github.com/user-attachments/assets/98fe6c62-18e0-48bc-b5eb-a4ea38ac0d73) ### Expected Behavior A new popup widget shows allowing the user select "Manufacturer" and "Device Type", listing all filtered modules bays: ![Image](https://github.com/user-attachments/assets/7330f4ce-97ee-4b95-b93f-4d441001f418) This screenshot is a Microsoft Paint concept, based on another working select filter in netbox ### Observed Behavior The UI greys out and freezes ![Image](https://github.com/user-attachments/assets/e6e9d976-7fb0-49d6-a053-4a75b6ae06c9)
adam added the type: bugstatus: acceptednetboxseverity: low labels 2025-12-29 21:41:37 +01:00
Author
Owner

@jnovinger commented on GitHub (May 16, 2025):

This is actually throwing an ImportError from a dynamic import that appears to be missing. In a dev environment (e.g. not demo.netbox.dev), you can see the actual traceback.

The above exception (module 'dcim.forms' has no attribute 'ModuleBayTemplateFilterForm') was the direct cause of the following exception:
  File "/Users/jnovinger/.virtualenvs/netbox/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/Users/jnovinger/.virtualenvs/netbox/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/jnovinger/.virtualenvs/netbox/lib/python3.10/site-packages/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
  File "/Users/jnovinger/.virtualenvs/netbox/lib/python3.10/site-packages/django/contrib/auth/mixins.py", line 73, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/Users/jnovinger/.virtualenvs/netbox/lib/python3.10/site-packages/django/views/generic/base.py", line 143, in dispatch
    return handler(request, *args, **kwargs)
  File "/Users/jnovinger/development/netbox-community/netbox/netbox/netbox/views/htmx.py", line 16, in get
    form_class = self._get_form_class(model)
  File "/Users/jnovinger/development/netbox-community/netbox/netbox/netbox/views/htmx.py", line 50, in _get_form_class
    return import_string(f'{app_label}.forms.{class_name}')
  File "/Users/jnovinger/.virtualenvs/netbox/lib/python3.10/site-packages/django/utils/module_loading.py", line 32, in import_string
    raise ImportError(

Exception Type: ImportError at /htmx/object-selector/
Exception Value: Module "dcim.forms" does not define a "ModuleBayTemplateFilterForm" attribute/class
@jnovinger commented on GitHub (May 16, 2025): This is actually throwing an `ImportError` from a dynamic import that appears to be missing. In a dev environment (e.g. not demo.netbox.dev), you can see the actual traceback. ``` The above exception (module 'dcim.forms' has no attribute 'ModuleBayTemplateFilterForm') was the direct cause of the following exception: File "/Users/jnovinger/.virtualenvs/netbox/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) File "/Users/jnovinger/.virtualenvs/netbox/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/Users/jnovinger/.virtualenvs/netbox/lib/python3.10/site-packages/django/views/generic/base.py", line 104, in view return self.dispatch(request, *args, **kwargs) File "/Users/jnovinger/.virtualenvs/netbox/lib/python3.10/site-packages/django/contrib/auth/mixins.py", line 73, in dispatch return super().dispatch(request, *args, **kwargs) File "/Users/jnovinger/.virtualenvs/netbox/lib/python3.10/site-packages/django/views/generic/base.py", line 143, in dispatch return handler(request, *args, **kwargs) File "/Users/jnovinger/development/netbox-community/netbox/netbox/netbox/views/htmx.py", line 16, in get form_class = self._get_form_class(model) File "/Users/jnovinger/development/netbox-community/netbox/netbox/netbox/views/htmx.py", line 50, in _get_form_class return import_string(f'{app_label}.forms.{class_name}') File "/Users/jnovinger/.virtualenvs/netbox/lib/python3.10/site-packages/django/utils/module_loading.py", line 32, in import_string raise ImportError( Exception Type: ImportError at /htmx/object-selector/ Exception Value: Module "dcim.forms" does not define a "ModuleBayTemplateFilterForm" attribute/class ```
Author
Owner

@github-actions[bot] commented on GitHub (Aug 15, 2025):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Aug 15, 2025): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/main/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Sep 15, 2025):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Sep 15, 2025): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Author
Owner

@callumau commented on GitHub (Dec 16, 2025):

Started having a look at this, appears to be related to all templates not just that specific template. Have a working one with positions filter and general search will add for all templates.

Happy to take ownership of this issue and make pr

@callumau commented on GitHub (Dec 16, 2025): Started having a look at this, appears to be related to all templates not just that specific template. Have a working one with positions filter and general search will add for all templates. Happy to take ownership of this issue and make pr
Author
Owner

@jnovinger commented on GitHub (Dec 16, 2025):

Thanks for volunteering, @callumau! Assigned to you.

@jnovinger commented on GitHub (Dec 16, 2025): Thanks for volunteering, @callumau! Assigned to you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11184