#22114: URLField form adds trailing slash to pathless URLs
---------------------------------+--------------------------------------
     Reporter:  coredumperror@…  |                    Owner:  nobody
         Type:  Bug              |                   Status:  new
    Component:  Forms            |                  Version:  1.6
     Severity:  Normal           |               Resolution:
     Keywords:                   |             Triage Stage:  Unreviewed
    Has patch:  0                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  1
---------------------------------+--------------------------------------

Comment (by coredumperror):

 Yeah, that would suck. You'd basically need to define models.URLField2 and
 forms.URLField2 (or something like that). Though, from my cursory reading
 of the API Stability page, this seems like a viable "Backwards
 incompatible change" for a minor version release. It's such a tiny
 difference.

 I wonder if it would be worthwhile, at least, to mention the bug and
 workaround for it in the docs for URLField. As far as I know, there are
 currently two ways to work around this:

 1) Define a custom field class that derives from CharField, doing the same
 thing as URLField but using a custom class for it's "form_class" setting
 in formfield(). That custom class is identical to forms.URLField, except
 for those offending lines.

 2) Define that same forms.URLField-like class, and use it in the
 "formfield_overrides" setting of your ModelAdmin-derived class in your
 admin.py file, as seen in my answer here:
 http://stackoverflow.com/a/21944976/464318

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22114#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/081.3eece997989128abf4c7051ae7b52f92%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to