Re: django-admin change form page validation

2012-04-03 Thread kenneth gonsalves
On Sat, 2012-03-31 at 09:25 +0530, Nikhil Verma wrote: > How can i do this kind validation where fields are dependent on each > other https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#adding-custom-validation-to-the-admin docs are wonderful -- regards Kenneth Gonsalves -- You received

Re: django-admin change form page validation

2012-04-02 Thread Tom Evans
On Sat, Mar 31, 2012 at 4:55 AM, Nikhil Verma wrote: > Hi All > > How can i apply validation in admin on various fields when they are > dependent on each other ? > There is good advice laid out in the docs for when you need to clean and validate fields that depend on

Re: django-admin change form page validation

2012-03-31 Thread Nikhil Verma
Hi I did not override response_change method but i override clean method by creating form in admin like this :- class InterviewAdminForm(forms.ModelForm): class Meta: model = Interview def clean(self, *args, **kwargs): cleaned_data = super(InterviewAdminForm,

Re: django-admin change form page validation

2012-03-30 Thread dummyman dummyman
ok. in admin,.py file override the response_change method def response_change(self,request,obj) obj is the handler so u can check using obj.field_name and take approp action On Sat, Mar 31, 2012 at 10:34 AM, Nikhil Verma wrote: > Hi > > I understand that but the

Re: django-admin change form page validation

2012-03-30 Thread Nikhil Verma
Hi I understand that but the problem is its a condition which i have to add if the revisit checkbox is selected and then in interview_type dropdown None option is selected ; after pressing save it should throw an error . None is an option in the dropdown . It is not blank=True and null =True

Re: django-admin change form page validation

2012-03-30 Thread dummyman dummyman
Hi unless u dont specify blank=True or null = True in modes for d corresponding fields, django will throw an errror if u don fill up the field On Sat, Mar 31, 2012 at 9:25 AM, Nikhil Verma wrote: > Hi All > > How can i apply validation in admin on various fields when