the fix is trivial, just change the regex to make the first part optional but I'm not sure if you'll prefer to simply drop that functionality on the widget and reject all those urls to retain compatibility.
looking at the order in which the methods are called on the Field class it seems the default "http://" is added before the validator gets called so it should work as expected, don't know where the error in validation was coming from.
On Fri, Jun 11, 2010 at 2:28 PM, Michael Cetrulo <mail2sa...@gmail.com>wrote:
> the fix is trivial, just change the regex to make the first part optional > but I'm not sure if you'll prefer to simply drop that functionality on the > widget and reject all those urls to retain compatibility.
turns out there is a problem, the field looks for "://" anywhere on the value but according to the RFC the colon is allowed on paths, so an url like 'www.example.com/://' should validate and it fails:
Python 2.6.4 (r264:75706, Jan 25 2010, 08:55:26) [GCC 4.4.2 20091208 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole)
>>> import django >>> django.VERSION
(1, 2, 1, 'final', 0)
>>> from django import forms >>> class MyForm(forms.Form):
> looking at the order in which the methods are called on the Field class it > seems the default "http://" is added before the validator gets called so > it should work as expected, don't know where the error in validation was > coming from.
> On Fri, Jun 11, 2010 at 2:28 PM, Michael Cetrulo <mail2sa...@gmail.com>wrote:
>> the fix is trivial, just change the regex to make the first part optional >> but I'm not sure if you'll prefer to simply drop that functionality on the >> widget and reject all those urls to retain compatibility.
On Sat, Jun 12, 2010 at 7:42 AM, MIL <needb...@gmail.com> wrote: > I was the guy that brought it up on #django > And I would like to follow this thread.
> Thanks :o)
> Michael Hjulskov
> -- > You received this message because you are subscribed to the Google Groups > "Django developers" group. > To post to this group, send email to django-developers@googlegroups.com. > To unsubscribe from this group, send email to > django-developers+unsubscribe@googlegroups.com<django-developers%2Bunsubscr ibe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/django-developers?hl=en.
I don't mean to wake a dead dog, but what has become of this? I came across this problem today. For now, I've subclassed. But it should be fixed, right?
> On Sat, Jun 12, 2010 at 7:42 AM, MIL <need...@gmail.com <javascript:>>wrote:
>> I was the guy that brought it up on #django >> And I would like to follow this thread.
>> Thanks :o)
>> Michael Hjulskov
>> -- >> You received this message because you are subscribed to the Google Groups >> "Django developers" group. >> To post to this group, send email to django-d...@googlegroups.com<javascript:> >> . >> To unsubscribe from this group, send email to >> django-develop...@googlegroups.com <javascript:>. >> For more options, visit this group at >> http://groups.google.com/group/django-developers?hl=en.
On Sun, Nov 18, 2012 at 12:21 AM, Jared Martin <jaredtmar...@gmail.com>wrote:
> I don't mean to wake a dead dog, but what has become of this? I came
> across this problem today. For now, I've subclassed. But it should be
> fixed, right?
Yes, it should be fixed. Per the ticket referenced it was fixed two years
ago. The specific scenario showin in the ticket is fixed:
Python 2.7.3 (default, Aug 1 2012, 05:16:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.get_version()
'1.4.2'
>>> from django.forms import URLField
>>> f = URLField()
>>> f.clean('www.example.com/://')
> On Sun, Nov 18, 2012 at 12:21 AM, Jared Martin <jaredtmar...@gmail.com> wrote:
> I don't mean to wake a dead dog, but what has become of this? I came across this problem today. For now, I've subclassed. But it should be fixed, right?
> Yes, it should be fixed. Per the ticket referenced it was fixed two years ago. The specific scenario showin in the ticket is fixed:
> Python 2.7.3 (default, Aug 1 2012, 05:16:07) > [GCC 4.6.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import django
> >>> django.get_version()
> '1.4.2'
> >>> from django.forms import URLField
> >>> f = URLField()
> >>> f.clean('www.example.com/://')
> u'http://www.example.com/://'
> So what do you mean, exactly, that you came across it today? What exactly is failing unexpectedly and on what version of Django?
> On Sat, Jun 12, 2010 at 7:42 AM, MIL <need...@gmail.com> wrote:
> I was the guy that brought it up on #django
> And I would like to follow this thread.
> Thanks :o)
> Michael Hjulskov
> -- > You received this message because you are subscribed to the Google Groups "Django developers" group.
> To post to this group, send email to django-developers@googlegroups.com.
> To unsubscribe from this group, send email to django-developers+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.