﻿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
4384	Defining newforms fields at runtime	sime <simon@…>	Adrian Holovaty	"I need to be able to define forms entirely at runtime (fields, choices, etc). Using form_for_xxx is fine, because it returns a class which you can manipulate using base_fields before initialising. 

Rather than use type(..) which seems messy, I've added the simple function to newforms. It returns a form class based on any given form class (Form itself by default).

Example --

DynForm = forms.new_form()
DynForm.base_fields['bla'] = ...
form = DynForm()

Or for manipulating a form you've already defined elsewhere --

SpecialForm = forms.new_form(StandardForm)
SpecialForm.base_fields['bla'] = ...
form = SpecialForm()
"		closed	Forms	dev		wontfix			Design decision needed	0	1	1	0	0	0
