Ticket #5619: get_filename_fix.diff
File get_filename_fix.diff, 933 bytes (added by , 17 years ago) |
---|
-
db/models/base.py
367 367 368 368 def _get_FIELD_filename(self, field): 369 369 if getattr(self, field.attname): # value is not blank 370 return os.path.join(settings.MEDIA_ROOT, getattr(self, field.attname))370 return os.path.join(settings.MEDIA_ROOT, field.get_filename(getattr(self, field.attname))) 371 371 return '' 372 372 373 373 def _get_FIELD_url(self, field): 374 374 if getattr(self, field.attname): # value is not blank 375 375 import urlparse 376 return urlparse.urljoin(settings.MEDIA_URL, getattr(self, field.attname)).replace('\\', '/')376 return urlparse.urljoin(settings.MEDIA_URL, field.get_filename(getattr(self, field.attname))).replace('\\', '/') 377 377 return '' 378 378 379 379 def _get_FIELD_size(self, field):