SHOW:
|
|
- or go back to the newest paste.
1 | def contact(request): | |
2 | form = FlexiForm(ContactForm, kwargs={'prefix': 'something-%s' % (some_id,), 'label_suffix': ': ',}) | |
3 | - | form = ContactForm(request.POST, prefix='something-%s' % (some_id,), label_suffix=': ') |
3 | + | |
4 | form.bind(request.POST) # substitutes internal ContactForm() with ContactForm(request.POST) | |
5 | if form.is_valid(): | |
6 | pass | |
7 | - | form = ContactForm(prefix='something-%s' % (some_id,), label_suffix=': ') |
7 | + | |
8 | pass # Form already instantiated! | |
9 | ||
10 | return render(request, 'contact.html', { | |
11 | 'form': form, | |
12 | }) |