To correct Kyle: if you override self.data you need to be careful about preserving any lists in the QueryDict. Therefore, Kyle's version should be something like (with appropriate indentation...): {{{ def full_clean(self): "Strip whitespace automatically in all form fields" data = self.data.copy() for k, vs in self.data.lists(): new_vs = [] for v in vs: new_vs.append(v.strip()) data.setlist(k, new_vs) self.data = data super(BaseForm, self).full_clean() }}}
Comment
To correct Kyle: if you override self.data you need to be careful about preserving any lists in the QueryDict. Therefore, Kyle's version should be something like (with appropriate indentation...):
{{{
def full_clean(self):
"Strip whitespace automatically in all form fields"
data = self.data.copy()
for k, vs in self.data.lists():
new_vs = []
for v in vs:
new_vs.append(v.strip())
data.setlist(k, new_vs)
self.data = data
super(BaseForm, self).full_clean()
}}}