FormSet validation - not sure how to implement

2010-12-21 Thread Michael Thamm
I am using 2 formsets on a template form and it shows fine but I don't know how to implement the form validation. Not allow a field to be empty. I have tried the basic method as documented but it doesn't trigger any messages. However, I also haven't put any defined errors anywhere so I don't know h

Re: FormSet validation - not sure how to implement

2010-12-22 Thread Michael Thamm
Never mind - I changed it to ModelForm class instead. >From what I have read, FormSet is not designed to be used in the generic form way. Rather for bulk adds or something like that. ModelForm works nice and easy. On Dec 21, 7:04 am, Michael Thamm wrote: > I am using 2 formsets on a te

get id to be used in a foreign key with two model forms

2010-12-22 Thread Michael Thamm
Hi, I am using 2 model forms and when I save the I get a save error since the foreign key field can't be blank. I try to add the new id at save, but it doesn't work. This is the code for the save. temp=shirtForm.save(commit=False) userForm.shirt=temp.id userForm.save() Is

Re: get id to be used in a foreign key with two model forms

2010-12-23 Thread Michael Thamm
erForm.is_valid(): temp=shirtForm.save() temp2=userForm.save(commit=False) temp2.shirt=temp shirtForm.save() temp2.save() return HttpResponseRedirect('/shirt/') # Redirect after POST On Dec 22, 10:49 pm, Michael Thamm wr

ModelForm Field not display choice text

2010-12-27 Thread Michael Thamm
Hi, I am using the jQuery stars on a radio field as a custom renderer. The stars come up nicely but the choice text still displays to the side of the stars. How can I not show the choice text but still populate the field with the choice result? I am displaying the field in the template like this: {

Re: ModelForm Field not display choice text

2010-12-27 Thread Michael Thamm
27, 6:39 am, Michael Thamm wrote: > Hi, > I am using the jQuery stars on a radio field as a custom renderer. The > stars come up nicely but the > choice text still displays to the side of the stars. > How can I not show the choice text but still populate the field with > the cho

Re: ModelForm Field not display choice text

2010-12-27 Thread Michael Thamm
t;) >                  }, >         }); >     } > > The key to hiding the other form elements (like the labels) is the $ > ('#stars').children().not(":radio").hide() call, which basically hides > everything but the actual stars. If the use doesn't have JS