[Python] Django form: what is the best way to modify posted data before validating?

Discussão em 'Python' iniciado por Stack, Setembro 30, 2024.

  1. Stack

    Stack Membro Participativo

    form = ContactForm(request.POST)

    # how to change form fields' values here?

    if form.is_valid():
    message = form.cleaned_data['message']


    Is there a good way to trim whitespace, modify some/all fields etc before validating data?

    Continue reading...

Compartilhe esta Página