Django

Code

Changeset 6068

Show
Ignore:
Timestamp:
09/08/07 14:26:15 (1 year ago)
Author:
gwilson
Message:

Fixed imports to adhere to PEP 8 and stripped trailing whitespace.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/validators.py

    r6067 r6068  
    1010 
    1111import urllib2 
    12 from django.conf import settings 
    13 from django.utils.translation import ugettext as _, ugettext_lazy, ungettext 
    14 from django.utils.functional import Promise, lazy 
    15 from django.utils.encoding import force_unicode 
    1612import re 
    1713try: 
     
    1915except ImportError: 
    2016    from django.utils._decimal import Decimal, DecimalException    # Python 2.3 
     17 
     18from django.conf import settings 
     19from django.utils.translation import ugettext as _, ugettext_lazy, ungettext 
     20from django.utils.functional import Promise, lazy 
     21from django.utils.encoding import force_unicode 
    2122 
    2223_datere = r'\d{4}-\d{1,2}-\d{1,2}' 
     
    149150    except ValueError, e: 
    150151        msg = _('Invalid date: %s') % _(str(e)) 
    151         raise ValidationError, msg     
     152        raise ValidationError, msg 
    152153 
    153154def isValidANSIDate(field_data, all_data): 
     
    252253    except: # urllib2.URLError, httplib.InvalidURL, etc. 
    253254        raise ValidationError, _("The URL %s is a broken link.") % field_data 
    254          
     255 
    255256def isValidUSState(field_data, all_data): 
    256257    "Checks that the given string is a valid two-letter U.S. state abbreviation" 
     
    381382 
    382383    def __call__(self, field_data, all_data): 
    383         # Try to make the value numeric. If this fails, we assume another  
     384        # Try to make the value numeric. If this fails, we assume another 
    384385        # validator will catch the problem. 
    385386        try: 
     
    387388        except ValueError: 
    388389            return 
    389              
     390 
    390391        # Now validate 
    391392        if self.lower and self.upper and (val < self.lower or val > self.upper): 
  • django/trunk/django/newforms/fields.py

    r6067 r6068  
    354354        self.filename = filename 
    355355        self.content = content 
    356          
     356 
    357357    def __unicode__(self): 
    358358        """ 
     
    397397            raise ValidationError(ugettext(u"Upload a valid image. The file you uploaded was either not an image or a corrupted image.")) 
    398398        return f 
    399          
     399 
    400400class URLField(RegexField): 
    401401    def __init__(self, max_length=None, min_length=None, verify_exists=False, 
     
    527527    """ 
    528528    A Field that aggregates the logic of multiple Fields. 
    529      
     529 
    530530    Its clean() method takes a "decompressed" list of values, which are then 
    531531    cleaned into a single value according to self.fields. Each value in