﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33501	order_with_respect_to uses incorrect database alias	Damian Posener	nobody	"When calling set_RELATED_order on a model that uses order_with_respect_to, if a DB router exists that routes that model to a non-default database, the routing is ignored, causing a datbase error to occur.

I've tracked this down to the method_set_order function here:
https://github.com/django/django/blob/3.2.12/django/db/models/base.py#L2117

This function updates `using=None` to `using=DEFAULT_DB_ALIAS`, which then overrides any database routing set up on the model manager. It should just pass through `using=None` so that the manager can deal with determining the correct connection to use.

I believe this got inadvertently broken in #30106 - previously the `using` parameter was actually being ignored, but when that got fixed it caused this new error. :)"	Uncategorized	new	Database layer (models, ORM)	3.2	Normal				Unreviewed	1	0	0	0	0	0
