Index: newforms/fields.py =================================================================== --- newforms/fields.py (revision 5753) +++ newforms/fields.py (working copy) @@ -101,12 +101,14 @@ return {} class CharField(Field): - def __init__(self, max_length=None, min_length=None, *args, **kwargs): - self.max_length, self.min_length = max_length, min_length + def __init__(self, max_length=None, min_length=None, strip=False, *args, **kwargs): + self.max_length, self.min_length, self.strip = max_length, min_length, strip super(CharField, self).__init__(*args, **kwargs) def clean(self, value): "Validates max_length and min_length. Returns a Unicode object." + if self.strip: + value = value.strip() super(CharField, self).clean(value) if value in EMPTY_VALUES: return u''