diff options
| author | Damian Posener <750763+deains@users.noreply.github.com> | 2022-02-07 15:06:25 +0000 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-09 13:31:49 +0100 |
| commit | 09e499a39eec9342cb594bfd27939cfd1046f797 (patch) | |
| tree | e7203ae3fed67802c159db6d1725971a17c8b654 /django | |
| parent | 2d472ad05c7fb2a5fe405be46af2062cdb5eaeee (diff) | |
Fixed #33501 -- Made order_with_respect_to respect database routers.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/base.py | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py index cf3f25319d..76beda4d84 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -17,7 +17,6 @@ from django.core.exceptions import ( ValidationError, ) from django.db import ( - DEFAULT_DB_ALIAS, DJANGO_VERSION_PICKLE_KEY, DatabaseError, connection, @@ -2370,8 +2369,6 @@ class Model(metaclass=ModelBase): def method_set_order(self, ordered_obj, id_list, using=None): - if using is None: - using = DEFAULT_DB_ALIAS order_wrt = ordered_obj._meta.order_with_respect_to filter_args = order_wrt.get_forward_related_filter(self) ordered_obj.objects.db_manager(using).filter(**filter_args).bulk_update( |
