add support for QuerySet.select_related()
Closed this issue · 1 comments
Jibola commented
Steps to reproduce
Successfully created a superuser. Once I created a superuser I attempted to work through the admin page. This then failed with the error QuerySet.select_related()
is not supported.
<pre class="exception_value" style="padding: 0px; margin: 10px 0px; font-size: 1.5em; white-space: pre-wrap; word-break: break-word; font-family: sans-serif; color: rgb(87, 87, 87); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">QuerySet.select_related() is not supported on MongoDB.</pre>
Request Method: | GET
-- | --
http://127.0.0.1:8000/admin/
5.0.6
NotSupportedError
QuerySet.select_related() is not supported on MongoDB.
/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12/site-packages/django_mongodb/compiler.py, line 113, in check_query
django.contrib.admin.sites.index
/opt/homebrew/Caskroom/miniforge/base/envs/django/bin/python
3.12.3
['/Users/jib/mongo/starterapp/storefront', '/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python312.zip', '/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12', '/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12/lib-dynload', '/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12/site-packages']
Environment
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 5.0.6
Python Version: 3.12.3
Installed Applications:
['apps.MongoAdminConfig',
'apps.MongoAuthConfig',
'apps.MongoContentTypesConfig',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'playground']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
timgraham commented
We can't support selected related until we support joins. If we can't support joins (or until we can, if it'll be a longer-term goal), we may be able to ignore select_related()
.