On Fri, 2007-11-23 at 14:45 +0100, Wolfram Kriesing wrote:
> On Nov 23, 2007 2:41 PM, Matthias Kestenholz <[EMAIL PROTECTED]> wrote:
> >
> >
> > On Fri, 2007-11-23 at 14:30 +0100, Wolfram Kriesing wrote:
> > > :-) yep we also discussed that here
> > > still it seems "wrong" that it needs to be done with such a hacky way 
> > > around
> > >
> >
> > I don't think that's hacky at all, really. If you want an URLField, you
> > get a field that guarantees that it really contains an URL. Otherwise it
> > should get called fields.MaybeURLField, and what would be the difference
> > between that and a plain CharField?
> >
> > You can even validate the URL in clean_url()
> >
> > But take whatever works for you...
> 
> sounds right too :-). thx for the help!
> but see the other two drawbacks i wrote in the other mail
> 

( From your other mail: )
> this has two drawbacks:
>  1)  the URL is validated in the "wrong" place (in clean() instead of
> clean_url())
>  2) the error, if one occurs, is not assigned to the errors['url']
> but errors['__all__']
> 
> 

I think the first point does not apply, or does it? If you throw a
ValidationError inside clean_url, the error message should really end up
in errors['url'], otherwise the newforms package would be broken.

Furthermore, if you want to store something else than an URL in an
URLField, you are making it harder for other people to work with your
code because you aren't conforming to their assumptions, which is
bad(tm)

Can you comment on your two points? I'm very new to django and would be
pleased to learn more about it..


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to