Re: Using clean_fields and full_clean in django Admin

2012-12-04 Thread nav
Thanks. It seems so obvious something kept telling that forms worked differently in the Admin interface compared to normal developer defined forms. This is exactly what I would have done if it was form that I had defined. Cheers, nav On Wednesday, December 5, 2012 5:21:37 AM UTC+5:30, Chris Co

Re: Using clean_fields and full_clean in django Admin

2012-12-04 Thread Chris Cogdon
Best thing I can suggest is to create a clean_FIELDNAME method in the ModelForm... this method should use self.cleaned_data['FIELDNAME'] to retrieve the value. check it, and return it if things are good, or raise ValidationError if things are bad. An alternate is to make the adjustment to the M

Using clean_fields and full_clean in django Admin

2012-12-04 Thread nav
Dear Folks, I have an Admin form which has two textfields namely country and state. I have made it more user friendly by making textfield a dropdown with the value to select for those fields. The model i have has some constraints which I cannot change i.e. that the country value must be a 2 le