On 05/12/2011 08:08 PM, Daniel França wrote:
no way? I'll need to create new model forms?
2011/5/12 Daniel França<daniel.fra...@gmail.com>
Hi all,
I need to override error messages (like for required fields) directly in
Models, I don't wanna duplicate code declaring some fields again in forms,
and in some cases I don't even create the forms, just using generic views
for model...
I was looking for a solution to change the default error messages (without
write this in all fields), but I didn't find anything, so I look for a
solution to write the error messages right in Models, I found this:
http://docs.djangoproject.com/en/dev/ref/models/fields/#error-messages
I'm running django 1.2.5
I did that for some fields in my model, and the error message still is the
default message "This field is required".
Anyone know how can I solve that without need to duplicate code?
What exactly did you change to attempt to override the error messages?
--
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
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.