Hi all,

I hope this is the right place to ask the question.  I searched around a
little but didn't find an answer.

I'd like to know why the developers decided to break the "open/closed"
principle by modifying the behavior of the ValidationError class so that it
no longer behaves like the parent class (Exception).

The difference I'm talking about is that the message attribute of a
ValidationError instance is a list instead of a string.

To access the message, you need to use:

e.message[0]

instead of the usual:

e.message

This makes it more difficult to integrate django validators in non-django
projects.  It is obviously possible to code around this but I am curious as
why it was done like this and what others have done to get around this.

Kind regards,
Matthys Kroon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to