Django cleanup form data

How can I clear and change form data in django. I would like to define it for each field for each model, as well as for ModelForms.

What I want to achieve automatically removes leading and trailing spaces from certain fields or turns the header (from one field) into a pool (which will be another field).

+7
python django forms slug
source share
1 answer

You can define clean_FIELD_NAME () methods that can check and modify data as described here: http://docs.djangoproject.com/en/dev/ref/forms/validation/#ref-forms-validation

+12
source share

All Articles