encode / django-vanilla-views

Beautifully simple class-based views.
http://django-vanilla-views.org/
BSD 2-Clause "Simplified" License
985 stars 74 forks source link

set field after form submission #32

Closed brechmos closed 10 years ago

brechmos commented 10 years ago

How do I set a model field after form submission? I have a model field that I am excluding from the form view and want to set it after the form is submitted based on a form field that was shown. I tried:

class PersonCreate(PersonCRUDView, CreateView): def form_valid(self, form): form.cleaned_data['ssn_last_four'] = form.cleaned_data['ssn'][-4:] return super(PersonCreate, self).form_valid(form)

but this isn't working. How do I do it?

tomchristie commented 10 years ago

Hiya,

I'd love to help but don't have the spare time to look into usage questions. The issue tracker is for bug reports and feature requests.

Sorry not to be more help.