﻿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
25759	Add **kwargs to as_sql method of Expressions	Josh Smeaton	Kai Feldhoff	"A common pattern when overriding `as_sql` or implementing `as_vendor` with expressions is to modify the template or function attributes before rendering the expression. This isn't safe to do, because expressions can be shared between backends.

It'd be a good idea to add `**kwargs` to the method signature, so that overrides can add context to that specific method call without mutating the expression itself. For expressions like `Func`, it could mix the `kwargs` with `self.extra` during rendering. Unsure how `**kwargs` would affect other expression types, but that can be opt in per type.

Once this is done, the documentation written for https://github.com/django/django/pull/5574 for third party backend overrides will need to be updated to take advantage of the new `kwargs`."	New feature	closed	Database layer (models, ORM)	dev	Normal	fixed	expressions	josh.smeaton@…	Accepted	1	0	0	0	0	0
