Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Jan. 19, 2011 14:30:06

g.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

URLField strange error


When I try to insert that string to urlfield:http://asd

Offline

#2 Jan. 19, 2011 17:58:28

a.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

URLField strange error


Something's not right with the data. Can you post more details - like, what
string are you trying to insert exactly?

--
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
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 Jan. 19, 2011 18:34:19

Ian C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

URLField strange error


On Wed, Jan 19, 2011 at 6:29 AM, galago <prog...@gmail.com> wrote:
> When I try to insert that string to urlfield:http://asd

Offline

#4 Jan. 19, 2011 18:38:04

g.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

URLField strange error


Django 1.2.4,
Python 2.7
All is coded as it should be. debugger shows error in python code as You
said. Maybe it will be fixed in the future. Exception is only when i put [ .
When i put all is ok :)

--
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
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#5 Jan. 19, 2011 19:16:40

Ian C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

URLField strange error


On Wed, Jan 19, 2011 at 10:37 AM, galago <prog...@gmail.com> wrote:
> Django 1.2.4,
> Python 2.7
> All is coded as it should be. debugger shows error in python code as You
> said. Maybe it will be fixed in the future. Exception is only when i put [ .
> When i put all is ok :)

Yes, either a bare '' in the URL hostname will trigger this error.

Oddly, the URLValidator in django.core.validators should be catching
the ValueError that is coming back from urllib2; Django should already
be handling this. How are you trying to insert the value? Is this
being handled through a ModelForm, or are you saving the model
manually?

Regards,
Ian Clelland
<clell...@gmail.com>

--
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
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#6 Jan. 19, 2011 19:36:55

g.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

URLField strange error


ModelForm:
class ArticleForm(ModelForm):
title =
forms.CharField(widget=forms.TextInput(attrs={'class':'input_visible_title',
'title' :
_(u'Tytuł'),}), max_length=255, min_length=3)
content =
forms.CharField(widget=forms.Textarea(attrs={'class':'add_editor'}),
min_length=200)
image_proposal =
forms.URLField(widget=forms.TextInput(attrs={'class':'input_visible_title',}),
max_length=255, required=False, verify_exists=False)
tags_tmp =
forms.CharField(widget=forms.TextInput(attrs={'class':'input_visible_title',}),
max_length=255, min_length=1)
categories =
forms.ModelMultipleChoiceField(queryset=Category.objects.all(),
widget=forms.CheckboxSelectMultiple)
is_sketch = forms.BooleanField(required=False)
class Meta:
model = Article
fields = ('title', 'content', 'categories', 'tags_tmp',
'image_proposal')

Model:
class Article(models.Model):
....
image_proposal = models.URLField(max_length=255, verify_exists=False,
blank=True)
....

def save(self):
if not self.pk:
self.slug = slughifi(self.title)
super(Article, self).save()


--
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
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support