django-multiform icon indicating copy to clipboard operation
django-multiform copied to clipboard

Documentation ambiguous

Open muelli opened this issue 12 years ago • 0 comments

Right now, the code in the documentation looks smth like this:

class FooBarForm(MultiForm):
    base_forms = {
        'foo': FooForm,
        'bar': BarForm
    }

# views.py
from django.views import generic
from .forms import FooBarForm

class FooBarView(generic.FormView):
    form_class = FooBarForm

    def form_valid(self, form):
        form.cleaned_data['foo'] # {'foo': ...}
        form.cleaned_data['bar'] # {'bar': ...}
        return super(FooBarView, self).form_valid(form)
        form.cleaned_data['bar'] # {'bar': ...}

is ambiguous and confused me as it is not clear what 'bar' will retrieve. It could be the form or the field named "bar".

muelli avatar Dec 17 '13 23:12 muelli