Hello - I am looking for a straightforward way to alter posted form data prior to when the form's full_clean() method is called. Specifically, I need to strip whitespace from any string data (such as for CharFields), and this needs to be done prior to when the individual fields' clean methods are called. In addition, several of our forms have fields that are dynamically added in the form's __init__ method. I have tried the following snippet, but it doesn't work for the dynamically added fields.
http://djangosnippets.org/snippets/956/ It's probably possible to copy the request.POST data into a mutable QueryDict, iterate through this data and the fields list to find the items that are meant to be strings, strip them, then copy the QueryDict back into an immutable QueryDict. But this seems like a lot of steps and potential for faults. It's also probably possible to override BaseForm's _clean_fields() protected method, but that doesn't seem right either. Any suggestions for a straightforward way to do this? Thanks - Rick -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.