﻿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
13972	Field initial value callable should take a request object as an argument	Mitar	nobody	"Currently it is possible to define initial value for a field as a callable. But this is quite limited in use as it does not take any context in which it should run.

I am proposing that it should take a request object. In this way it is possible to set initial values based on a request. For example, based on GeoIP information. We should pass a request object to the form constructor which would then pass it along to the those callables.

I am attaching a short helper function which allows me that I define such callables already. It postprocesses the form class so that request is available to callables. So in the view it is necessary just to construct your form with:

{{{
form = initial_accepts_request(request, MyForm)()
}}}

It still allows initial values to be passed at construction time and they override callables.

But it would be much better if this would be officially supported."	New feature	closed	Forms	1.2	Normal	wontfix		mmitar@…	Design decision needed	0	0	0	0	0	0
