You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Followed instructions for initial setup from #18. Created my first admin account. From there, I called python manage.py makemigrations which worked. Afterward I then called python manage.py migrate which led to this initial error.
python manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
Applying admin.0004_alter_logentry_id... OK
Applying auth.0013_alter_group_id_alter_permission_id_alter_user_id... OK
Applying contenttypes.0003_alter_contenttype_id... OK
Traceback (most recent call last):
File "/Users/jib/mongo/starterapp/storefront/manage.py", line 22, in<module>main()
File "/Users/jib/mongo/starterapp/storefront/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12/site-packages/django/core/management/base.py", line 413, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12/site-packages/django/core/management/base.py", line 459, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12/site-packages/django/core/management/base.py", line 107, in wrapper
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12/site-packages/django/core/management/commands/migrate.py", line 383, in handle
emit_post_migrate_signal(
File "/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12/site-packages/django/core/management/sql.py", line 52, in emit_post_migrate_signal
models.signals.post_migrate.send(
File "/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12/site-packages/django/dispatch/dispatcher.py", line 189, in send
response = receiver(signal=self, sender=sender, **named)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12/site-packages/django/contrib/auth/management/__init__.py", line 91, in create_permissions
all_perms = set(
^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12/site-packages/django/db/models/query.py", line 400, in __iter__
self._fetch_all()
File "/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12/site-packages/django/db/models/query.py", line 1928, in _fetch_all
self._result_cache = list(self._iterable_class(self))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12/site-packages/django_mongodb/compiler.py", line 47, in results_iter
results = self.build_query(columns).fetch()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12/site-packages/django_mongodb/compiler.py", line 140, in build_query
query.order_by(self._get_ordering())
^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/django/lib/python3.12/site-packages/django_mongodb/compiler.py", line 170, in _get_ordering
raise NotSupportedError("Ordering can't span tables on MongoDB (%s)." % order)
django.db.utils.NotSupportedError: Ordering can't span tables on MongoDB (content_type__app_label).
The text was updated successfully, but these errors were encountered:
We can't support ordering on related tables until we support joins. If we can't support joins (or until we can, if it'll be a longer-term goal), we could ignore ordering if it references a related table.
timgraham
changed the title
django.db.utils NotSupporteError: Ordering can't span tables on MongoDB (content_type__app_label)
NotSupportedError: Ordering can't span tables on MongoDB (content_type__app_label)
May 21, 2024
We can't support ordering on related tables until we support joins. If we can't support joins (or until we can, if it'll be a longer-term goal), we could ignore ordering if it references a related table.
Good to note. I'd say we will have to put strong efforts into support joins via the $lookup operator. That or we need to unpack all of the underlying join operations associated with the builtin admin package.
Steps to reproduce
Followed instructions for initial setup from #18. Created my first admin account. From there, I called
python manage.py makemigrations
which worked. Afterward I then calledpython manage.py migrate
which led to this initial error.The text was updated successfully, but these errors were encountered: