Fixed #413 -- get_file_url() for FileFields now uses proper slashes on Windows. Thanks, Adam Endicott

git-svn-id: http://code.djangoproject.com/svn/django/trunk@579 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-08-31 16:22:07 +00:00
parent 5569c75eb6
commit abe7fb8173
1 changed files with 1 additions and 1 deletions

View File

@ -996,7 +996,7 @@ def method_get_file_filename(field, self):
def method_get_file_url(field, self): def method_get_file_url(field, self):
if getattr(self, field.name): # value is not blank if getattr(self, field.name): # value is not blank
import urlparse import urlparse
return urlparse.urljoin(settings.MEDIA_URL, getattr(self, field.name)) return urlparse.urljoin(settings.MEDIA_URL, getattr(self, field.name)).replace('\\', '/')
return '' return ''
def method_get_file_size(field, self): def method_get_file_size(field, self):