-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closes #19924: Record model features on ObjectType #19939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests pass fine locally, however if I try to go to any web page I get the error shown below. I've disabled all plugins and switching to main everything works fine. Restored the database as well and that didn't change anything.
Traceback (most recent call last):
File "/Users/ahanson/dev/work/netbox/venv/lib/python3.13/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/Users/ahanson/dev/work/netbox/venv/lib/python3.13/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/ahanson/dev/work/netbox/venv/lib/python3.13/site-packages/django/views/generic/base.py", line 104, in view
return self.dispatch(request, *args, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahanson/dev/work/netbox/netbox/netbox/views/generic/base.py", line 77, in dispatch
return super().dispatch(request, *args, **kwargs)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahanson/dev/work/netbox/netbox/utilities/views.py", line 125, in dispatch
return super().dispatch(request, *args, **kwargs)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahanson/dev/work/netbox/netbox/utilities/views.py", line 39, in dispatch
return super().dispatch(request, *args, **kwargs)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahanson/dev/work/netbox/venv/lib/python3.13/site-packages/django/views/generic/base.py", line 143, in dispatch
return handler(request, *args, **kwargs)
File "/Users/ahanson/dev/work/netbox/netbox/netbox/views/generic/bulk_views.py", line 154, in get
self.queryset = self.filterset(request.GET, self.queryset, request=request).qs
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahanson/dev/work/netbox/netbox/netbox/filtersets.py", line 305, in __init__
for custom_field in custom_fields:
^^^^^^^^^^^^^
File "/Users/ahanson/dev/work/netbox/venv/lib/python3.13/site-packages/django/db/models/query.py", line 384, in __iter__
self._fetch_all()
~~~~~~~~~~~~~~~^^
File "/Users/ahanson/dev/work/netbox/venv/lib/python3.13/site-packages/django/db/models/query.py", line 1949, in _fetch_all
self._result_cache = list(self._iterable_class(self))
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahanson/dev/work/netbox/venv/lib/python3.13/site-packages/django/db/models/query.py", line 91, in __iter__
results = compiler.execute_sql(
chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size
)
File "/Users/ahanson/dev/work/netbox/venv/lib/python3.13/site-packages/django/db/models/sql/compiler.py", line 1623, in execute_sql
cursor.execute(sql, params)
~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/Users/ahanson/dev/work/netbox/venv/lib/python3.13/site-packages/debug_toolbar/panels/sql/tracking.py", line 235, in execute
return self._record(super().execute, sql, params)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahanson/dev/work/netbox/venv/lib/python3.13/site-packages/debug_toolbar/panels/sql/tracking.py", line 160, in _record
return method(sql, params)
File "/Users/ahanson/dev/work/netbox/venv/lib/python3.13/site-packages/django/db/backends/utils.py", line 122, in execute
return super().execute(sql, params)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/Users/ahanson/dev/work/netbox/venv/lib/python3.13/site-packages/django/db/backends/utils.py", line 79, in execute
return self._execute_with_wrappers(
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
sql, params, many=False, executor=self._execute
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/Users/ahanson/dev/work/netbox/venv/lib/python3.13/site-packages/django/db/backends/utils.py", line 92, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/Users/ahanson/dev/work/netbox/venv/lib/python3.13/site-packages/django/db/backends/utils.py", line 100, in _execute
with self.db.wrap_database_errors:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahanson/dev/work/netbox/venv/lib/python3.13/site-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/Users/ahanson/dev/work/netbox/venv/lib/python3.13/site-packages/django/db/backends/utils.py", line 105, in _execute
return self.cursor.execute(sql, params)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/Users/ahanson/dev/work/netbox/venv/lib/python3.13/site-packages/psycopg/cursor.py", line 97, in execute
raise ex.with_traceback(None)
django.db.utils.ProgrammingError: column extras_customfield_object_types.contenttype_id does not exist
LINE 1: ...ustomfield_object_types"."customfield_id") WHERE ("extras_cu...
Confirmed the above error on my local. It's failing to find Looks like this query: netbox/netbox/netbox/filtersets.py Lines 297 to 302 in 9ccc7d2
|
@jeremystretch I don't think it should have Group and Permission in here, should it? (Custom Field object type picker) ![]() |
Closes: #19924
netbox/models/contenttypes.py
toobject_types.py
public
BooleanField indicating whether the corresponding model is considered publicfeatures
ArrayField storing the names of all features supported by the modelhas_feature()
utility function for determining whether a model supports a specific feature