Code

Opened 7 years ago

Closed 7 years ago

#5316 closed (invalid)

newforms issue form_for_model() got an unexpected keyword argument 'fields'

Reported by: ramadantariq@… Owned by: adrian
Component: Forms Version: 0.96
Severity: Keywords: new forms form_for_model() got an unexpected keyword argument 'fields'
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

i have an issue with newforms for some reason i can create a form from a model
but when it try to create a subset of form using following code

UForm = forms.form_for_model(User, fields=('firstName', 'lastName'))
UserForm=UForm()
return render_to_response('test.html', {'form': UserForm})

i get the following error
form_for_model() got an unexpected keyword argument 'fields'

i have 0.96 installed i'm not sure if there is a patch for it

Attachments (0)

Change History (1)

comment:1 Changed 7 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

Fields was added post-0.96. The section in the documentation on specifying a fields argument to form_for_model states that this feature is new in the development version.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.