Re: ModelForm and MultiValueField

2008-05-23 Thread fivaldi
Hi Omat, Sorry it took me a while to answer, but if you have not yet found the answer to your problem, maybe this will help: The clean_date() method will only be called when the compress() method did not raise any ValidationErrors (cleaned_data is only available when all fields validate, and onl

Re: ModelForm and MultiValueField

2008-05-20 Thread omat
Thanks for the reply. Here are the HistoricDateField and the HistoricDateWidget classes: http://dpaste.com/hold/51690/ -- omat On May 20, 8:08 pm, fivaldi <[EMAIL PROTECTED]> wrote: > Hi Omat, > > Does your HistoricDateField implement the compress(self, data_list) > method and _not_ the clea

Re: ModelForm and MultiValueField

2008-05-20 Thread fivaldi
Hi Omat, Does your HistoricDateField implement the compress(self, data_list) method and _not_ the clean(self, value) method? See the implementation comments in django.newforms.fields.MultiValueField. The compress method should also return the compressed value of the historic date (i.e. one value

ModelForm and MultiValueField

2008-05-20 Thread omat
Hi all, I wish to have an extra date field in my ModelForm. When I do it as follows, it works fine: class NoteForm(forms.ModelForm): date = DateField(required=False) def clean_date(self): # do the validation ... return self.cleaned_data class Meta: model = N