﻿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
24509	Allow Expressions when saving new models	Alex Hill	nobody	"Opening a ticket after discussion on IRC with Josh.

You can use `Expression` when updating models, but it would also be useful to be able to use them when creating models, particularly in order to apply database functions to newly-inserted values.

My specific use case for this is a PostgreSQL `TSVectorField`, where instead of just inserting a value, I want to insert `strip(to_tsvector(<ts_config>, unaccent(<value>)))`. Ideally, I would be able to define these all as `Func`s and insert an `Expression`.

I propose to fix this by making `SQLInsertCompiler` check for `resolve_expressions` and `as_sql`, as `SQLUpdateCompiler` does.

Alex"	New feature	new	Database layer (models, ORM)	dev	Normal				Unreviewed	0	0	0	0	0	0
