Hi

New to django, and just loving it!

Got the basics working - had the following question.

What would be the preferred way to associate an error code with an
error message (so that say it can be given back to an api call)

class MyForm(forms.Form):
   email = forms.CharField(error_messages={'invalid' : _('10001 :
Email address is invalid')})

If form validation fails I would want to send associated error code to
api client, but on the web interface the error code need not appear.

If I stick the code in the translatable string a I have done then
localization files might look ugly?

Any suggestions on how the rest of the world does it would be very
helpful :)

Thanks a bunch

Ajai

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.

Reply via email to