mirror of
https://github.com/django/django.git
synced 2024-12-26 11:06:07 +00:00
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:
parent
5569c75eb6
commit
abe7fb8173
@ -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):
|
||||||
|
Loading…
Reference in New Issue
Block a user