All pastes #148136 Raw Edit

Unnamed

public python v1 · immutable
#148136 ·published 2006-08-24 22:21 UTC
rendered paste body
TEMPLATE--------<form method="post" enctype="multipart/form-data" action=".">    ...    <label for="id_file">Torrent file</label>{{ form.file }}    {{ form.file_file }}    ...</form>VIEW----...def add_something(request):    manipulator = Something.AddManipulator()    if request.POST:        new_data = request.POST.copy()        new_data.update(request.FILES)        errors = manipulator.get_validation_errors(new_data)        if not errors:            manipulator.do_html2python(new_data)            new_something = manipulator.save(new_data)    else:        errors = new_data = {}    form = forms.FormWrapper(manipulator, new_data, errors)    return render_to_response('things/something_form.html', {'form': form})