views:

300

answers:

4

In which file or form should validation code be written ?

+5  A: 

In the file where you define the form class.

You might want to read the documentation on form validation. There's a decent example on that page of validation on a form as a whole and on individual components of forms.

Dominic Rodger
thanks Dominic ..........
+1  A: 

Usually it's "forms.py"

Glader
A: 

Form validation in django is a done by methods on the form class.

Django does not impose any conditions on where forms have to be defined.

They are, often defined, by convention, in a file called forms.py

Lakshman Prasad
A: 

form validation , batter to define in models.py

so at first you have to define a function then you can use this link for more information

http://docs.djangoproject.com/en/dev/ref/forms/validation/

nazmul hasan