Closed pat1 closed 3 years ago
http://localhost:8888/admin/stations/sensortype/?q=ith
Environment: Request Method: GET Request URL: http://localhost:8888/admin/stations/sensortype/?q=ith Django Version: 2.2.17 Python Version: 3.8.7 Installed Applications: ['registration', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.admin', 'django.contrib.staticfiles', 'rmap.doc', 'rmap', 'rmap.stations', 'rmap.network', 'django_hosts', 'corsheaders', 'leaflet', 'djgeojson', 'geoimage', 'insertdata', 'imagekit', 'showdata', 'amatyr', 'borinud', 'http2mqtt', 'cookielaw', 'graphite-dballe', 'graphite-dballe.metrics', 'graphite-dballe.render', 'graphite-dballe.browser', 'graphite-dballe.composer', 'graphite-dballe.account', 'graphite-dballe.dashboard', 'graphite-dballe.whitelist', 'graphite-dballe.events', 'graphite-dballe.url_shortener', 'tagging', 'django_extensions', 'rainbo', 'borinud_sos', 'contacts', 'firmware_updater'] Installed Middleware: ['django_hosts.middleware.HostsRequestMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.cache.UpdateCacheMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'rmap.stations.middleware.ProfileMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.cache.FetchFromCacheMiddleware', 'django_hosts.middleware.HostsResponseMiddleware'] Traceback: File "/usr/lib/python3.8/site-packages/django/core/handlers/exception.py" in inner 34. response = get_response(request) File "/usr/lib/python3.8/site-packages/django/core/handlers/base.py" in _get_response 115. response = self.process_exception_by_middleware(e, request) File "/usr/lib/python3.8/site-packages/django/core/handlers/base.py" in _get_response 113. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python3.8/site-packages/django/contrib/admin/options.py" in wrapper 606. return self.admin_site.admin_view(view)(*args, **kwargs) File "/usr/lib/python3.8/site-packages/django/utils/decorators.py" in _wrapped_view 142. response = view_func(request, *args, **kwargs) File "/usr/lib/python3.8/site-packages/django/views/decorators/cache.py" in _wrapped_view_func 44. response = view_func(request, *args, **kwargs) File "/usr/lib/python3.8/site-packages/django/contrib/admin/sites.py" in inner 223. return view(request, *args, **kwargs) File "/usr/lib/python3.8/site-packages/django/utils/decorators.py" in _wrapper 45. return bound_method(*args, **kwargs) File "/usr/lib/python3.8/site-packages/django/utils/decorators.py" in _wrapped_view 142. response = view_func(request, *args, **kwargs) File "/usr/lib/python3.8/site-packages/django/contrib/admin/options.py" in changelist_view 1685. cl = self.get_changelist_instance(request) File "/usr/lib/python3.8/site-packages/django/contrib/admin/options.py" in get_changelist_instance 731. return ChangeList( File "/usr/lib/python3.8/site-packages/django/contrib/admin/views/main.py" in __init__ 81. self.queryset = self.get_queryset(request) File "/usr/lib/python3.8/site-packages/django/contrib/admin/views/main.py" in get_queryset 439. qs, search_use_distinct = self.model_admin.get_search_results(request, qs, self.query) File "/usr/lib/python3.8/site-packages/django/contrib/admin/options.py" in get_search_results 1023. queryset = queryset.filter(reduce(operator.or_, or_queries)) File "/usr/lib/python3.8/site-packages/django/db/models/query.py" in filter 892. return self._filter_or_exclude(False, *args, **kwargs) File "/usr/lib/python3.8/site-packages/django/db/models/query.py" in _filter_or_exclude 910. clone.query.add_q(Q(*args, **kwargs)) File "/usr/lib/python3.8/site-packages/django/db/models/sql/query.py" in add_q 1290. clause, _ = self._add_q(q_object, self.used_aliases) File "/usr/lib/python3.8/site-packages/django/db/models/sql/query.py" in _add_q 1310. child_clause, needed_inner = self._add_q( File "/usr/lib/python3.8/site-packages/django/db/models/sql/query.py" in _add_q 1315. child_clause, needed_inner = self.build_filter( File "/usr/lib/python3.8/site-packages/django/db/models/sql/query.py" in build_filter 1251. condition = self.build_lookup(lookups, col, value) File "/usr/lib/python3.8/site-packages/django/db/models/sql/query.py" in build_lookup 1107. raise FieldError('Related Field got invalid lookup: {}'.format(lookup_name)) Exception Type: FieldError at /admin/stations/sensortype/ Exception Value: Related Field got invalid lookup: icontains
solved
http://localhost:8888/admin/stations/sensortype/?q=ith