Use validators in newforms.
class MyForm(newforms.Form):
secret_phrase = newforms.CharField(label='Secret phrase',
required=True)
def clean_secret_phrase(self):
if self.cleaned_data.get('secret_phrase') == 'xyzzy':
return True
else:
raise newforms.ValidationError(u'This is not the secret
phrase.')
On Aug 8, 8:14 am, Ramdas S <[EMAIL PROTECTED]> wrote:
> It is clear that old forms and manipulators will be replaced with new
> forms. But what about Django.core.validators. Will that too go off? If
> so, what do we use?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---