﻿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
20826	Move `Manager.raw()` and `Manager._insert()` to the QuerySet class.	loic84	nobody	"After the introduction of #20625, most methods that involve a DB query have been removed from `Manager` and are automatically proxied to `QuerySet`, only `raw()` and `_insert()` remain. After discussion with @akaariai on IRC we came to the conclusion that it would make sense to move these to the `QuerySet` class as well.

The previous goal was for `QuerySet` to focus on retrieval,  but this has somewhat failed as most methods that could belong to `Manager` (like `create()`) already live on the `QuerySet` class. The introduction of hybrid methods like `get_or_create()` or `update_or_create()` also demonstrates that the distinction between the different kinds of queries is not obvious to make.

If this ticket is accepted, the new objective would be defined as follows:
- Anything ""query"" belongs to `QuerySet`.
- `Manager` is responsible for the integration between a `Model` and a `QuerySet`.
- `Manager` works as a hook to pre/post-process or even replace `QuerySet` methods when needed. (See current implementation of `Manager.all()` or `RelatedManager.create()`).
"	Cleanup/optimization	closed	Database layer (models, ORM)	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
