1

In which file or form should validation code be written ?

2
  • 3
    Since you are new here I won't downvote. Next time write your problem with more details about what you need. Also get rid of the multiple question marks. Commented Jun 23, 2009 at 9:45
  • 1
    Cleaned up, but I can't add the missing info. Commented Jun 23, 2009 at 10:00

4 Answers 4

5

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.

Sign up to request clarification or add additional context in comments.

Comments

1

Usually it's "forms.py"

Comments

0

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

Comments

0

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/

Comments