Django

Code

Changeset 5625

Show
Ignore:
Timestamp:
07/06/07 05:21:14 (2 years ago)
Author:
mtredinnick
Message:

Fixed #4776 -- Fixed a problem with handling of upload_to attributes. The new
solution still works with non-ASCII filenames. Based on a patch from
mike.j.thompson@gmail.com.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/db/models/fields/__init__.py

    r5609 r5625  
    1010from django.utils.text import capfirst 
    1111from django.utils.translation import ugettext_lazy, ugettext as _ 
    12 from django.utils.encoding import smart_unicode 
     12from django.utils.encoding import smart_unicode, force_unicode, smart_str 
    1313import datetime, os, time 
    1414try: 
     
    736736 
    737737    def get_directory_name(self): 
    738         return os.path.normpath(datetime.datetime.now().strftime(self.upload_to)) 
     738        return os.path.normpath(force_unicode(datetime.datetime.now().strftime(smart_str(self.upload_to)))) 
    739739 
    740740    def get_filename(self, filename):