Django

Code

Show
Ignore:
Timestamp:
08/05/08 12:15:33 (5 months ago)
Author:
jbronn
Message:

gis: Merged revisions 7981-8001,8003-8011,8013-8033,8035-8036,8038-8039,8041-8063,8065-8076,8078-8139,8141-8154,8156-8214 via svnmerge from trunk.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/gis

    • Property svnmerge-integrated changed from /django/trunk:1-7978 to /django/trunk:1-8214
  • django/branches/gis/django/forms/fields.py

    r7979 r8215  
    88import re 
    99import time 
     10import urlparse 
    1011try: 
    1112    from cStringIO import StringIO 
     
    2425 
    2526from django.utils.translation import ugettext_lazy as _ 
    26 from django.utils.encoding import StrAndUnicode, smart_unicode, smart_str 
     27from django.utils.encoding import smart_unicode, smart_str 
    2728 
    2829from util import ErrorList, ValidationError 
     
    7475            label = smart_unicode(label) 
    7576        self.required, self.label, self.initial = required, label, initial 
    76         self.help_text = smart_unicode(help_text or '') 
     77        if help_text is None: 
     78            self.help_text = u'' 
     79        else: 
     80            self.help_text = smart_unicode(help_text) 
    7781        widget = widget or self.widget 
    7882        if isinstance(widget, type): 
     
    504508            trial_image = Image.open(file) 
    505509            trial_image.verify() 
     510        except ImportError:  
     511            # Under PyPy, it is possible to import PIL. However, the underlying 
     512            # _imaging C module isn't available, so an ImportError will be  
     513            # raised. Catch and re-raise.  
     514            raise 
    506515        except Exception: # Python Imaging Library doesn't recognize it as an image 
    507516            raise ValidationError(self.error_messages['invalid_image']) 
     
    535544        if value and '://' not in value: 
    536545            value = u'http://%s' % value 
     546        # If no URL path given, assume / 
     547        if value and not urlparse.urlsplit(value)[2]: 
     548            value += '/' 
    537549        value = super(URLField, self).clean(value) 
    538550        if value == u'':