Re: Forms: set required value at runtime

2010-10-24 Thread bobo
> Bence, > > I think your problem is related to the second case described in > documentation about validation fields that depend on each other [1]. > > Just an observation about your design, if I may: I believe you should > explicitly set and store both addresses. You will ease user task by > provi

Re: Forms: set required value at runtime

2010-10-23 Thread werefr0g
Bence, I think your problem is related to the second case described in documentation about validation fields that depend on each other [1]. Just an observation about your design, if I may: I believe you should explicitly set and store both addresses. You will ease user task by providing a wi

Re: Forms: set required value at runtime

2010-10-23 Thread widoyo
On Oct 24, 3:28 am, bobo wrote: > I'd like to do, if I uncheck the 'same' field, then the required for > the post_address change to True. > I tried width the overall clean method, but when I raise > forms.ValidationError, I can't raise the error for the post_address > field. > > Can I change the r

Forms: set required value at runtime

2010-10-23 Thread bobo
Hi All, I have a form, width two different address field (invoice and post) and a booleanfield: class AddressForm(forms.Form): invoice_address = forms.CharField(max_length=255) same = forms.BooleanField(initial=True) post_address = forms.CharField(max_length=255,required=False) I'd l