﻿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
27614	Store the DB used in the state before calling Model._save_table()	Joseph Kahn	nobody	"I was trying to figure out why when calling `.using` before `.create` the `self._state.db` was not available. I happen to want the result of that to use in the `pk` value, so right now I have to re fetch that information. As it turns out, the cause can be narrowed down to a single line. However, I'm not sure if it was ordered that way for a reason but here:
https://github.com/django/django/blob/d2a26c1a90e837777dabdf3d67ceec4d2a70fb86/django/db/models/base.py#L831-L836

Since not every function call gets the `using` param passed to it, but most get the `instance` like when it wants to get a pk value prior to saving.

I was wondering if it's possible to move that `self._state.db = using` up."	Cleanup/optimization	new	Database layer (models, ORM)	1.10	Normal				Accepted	0	0	1	0	0	0
