This commit is contained in:
Mihail Burduja 2014-08-18 21:10:00 +00:00
commit 363c547e40
2 changed files with 5 additions and 0 deletions

View File

@ -973,6 +973,8 @@ class FileField(WritableField):
return data return data
def to_native(self, value): def to_native(self, value):
if api_settings.PREPEND_MEDIA_URL:
return settings.MEDIA_URL + value.name
return value.name return value.name

View File

@ -119,6 +119,9 @@ DEFAULTS = {
# Pending deprecation # Pending deprecation
'FILTER_BACKEND': None, 'FILTER_BACKEND': None,
# Prepending MEDIA_URL to FileField
'PREPEND_MEDIA_URL': False,
} }