On Feb 5, 10:17 am, Adam Radestock <a...@stainlessgames.com> wrote:
> I'm trying to get a URLField to NOT check the URL is valid on form
> submission, but the damn thing won't listen!
> I have the following model defined in my models.py:
>
> class SubversionRepository(models.Model):
>         name = models.CharField(max_length=200)
>         url = models.URLField(verify_exists=False, max_length=400)
>         working_copy_path = models.CharField(max_length=400)
>         username = models.CharField(max_length=200)
>         password = models.CharField(max_length=200)
>         project = models.ForeignKey(Project)
>
>         def __unicode__(self):
>                 return self.name
>
> This is because the subversion server returns a response asking for
> username and password, and so triggers the 'not valid URL' error when
> I try and submit the form in the admin interface.
>
> Can anyone suggest what I might be doing wrong?

The URLField needs an http or an https protocol in the URL. If you are
using an svn:// or svn+ssh:// URL, it won't validate (use a plain
CharField or a custom field in that case.)

Also, when you get the error 'Enter a valid URL', it means the URL is
simply invalid. On the other hand, when verify_exists fails to find
the resource at your URL you will get a different message: 'This URL
appears to be a broken link.'

-RD

--~--~---------~--~----~------------~-------~--~----~
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 at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to