Changeset 8215 for django/branches/gis/django/forms/fields.py
- Timestamp:
- 08/05/08 12:15:33 (5 months ago)
- Files:
-
- django/branches/gis (modified) (1 prop)
- django/branches/gis/django/forms/fields.py (modified) (5 diffs)
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 8 8 import re 9 9 import time 10 import urlparse 10 11 try: 11 12 from cStringIO import StringIO … … 24 25 25 26 from django.utils.translation import ugettext_lazy as _ 26 from django.utils.encoding import StrAndUnicode,smart_unicode, smart_str27 from django.utils.encoding import smart_unicode, smart_str 27 28 28 29 from util import ErrorList, ValidationError … … 74 75 label = smart_unicode(label) 75 76 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) 77 81 widget = widget or self.widget 78 82 if isinstance(widget, type): … … 504 508 trial_image = Image.open(file) 505 509 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 506 515 except Exception: # Python Imaging Library doesn't recognize it as an image 507 516 raise ValidationError(self.error_messages['invalid_image']) … … 535 544 if value and '://' not in value: 536 545 value = u'http://%s' % value 546 # If no URL path given, assume / 547 if value and not urlparse.urlsplit(value)[2]: 548 value += '/' 537 549 value = super(URLField, self).clean(value) 538 550 if value == u'':
