Hello,

I am terribly sorry to have brought this up here, but I would like to
direct some of your attention to the ticket #13184 (http://
code.djangoproject.com/ticket/13184). In a nutshell, you can not raise
ValidationError in the to_python method of a custom model field if
that field has __metaclass__ = models.SubfieldBase (and, quite
frankly, that's something you would like to do, usually), - doing so
breaks form validation (the ValidationError is not caught and
propagates beyond is_valid method of the form instance).

So that means, that either you have *working* form validation, or you
have automatic database-type<->python-type conversion for your custom
model fields, not both at the same time. Which is not all that
terrible, but the documentation never actually mentions this, which
leads me to think, that this is not the way it is supposed to be.

Now, to the actual purpose of this message, - I am more than willing
to take a stab at this issue, only I am not quite sure how exactly it
should be solved. The reply in the tracker mentions three possible
ways to fix this: a fix for the documentation, that will possibly
mention the fact, that you have to provide custom form logic in order
for SubfieldBase to work, two others being the suggestions to alter
the existing form logic slightly (I like this idea more, to be
honest).

It would be really great if someone, who is in in charge (sort of),
could provide at least a little insight on the preferred way of
solving this, so that it can be fixed before 1.2 release.

I would like to mention, that the ticket has a runnable, minimal (-
ish) test case attached, that illustrates the problem, in my opinion,
quite clearly.

With apologies,
Mark

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to