Well, I have found it
username = forms.CharField(max_length=15, required=True,
error_messages={'requied': 'Your username can't be empty'})
On Sep 21, 1:29 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> now the django form errors is like that :
>
> {{ form.username.errors }}
> <ul class="errorlist"><li>This field is requied.</li></ul>
>
> I want custom it to :
> {{ form.username.errors }}
> <span class="errors">Your usrename can't be empty</span>
>
> I have try to modify the forms.py
>
> ...
>
> username = forms.CharField(max_length=15, required=False)
>
> def clean_username(self):
> if not self.cleaned_username:
> raise forms.ValidationError("Your username can't be empty.")
> ...
>
> Is there another way to do it ?
> I need to custom the style and the message.
>
> Thank you very much.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---