def process_form(request, form_class, form_dict=None, save_kwargs=None, *a, **kw):
form = form_class(form_dict or request.POST or None, *a, **kw)<EOL>if request.method == '<STR_LIT:POST>':<EOL><INDENT>if form.is_valid():<EOL><INDENT>if not save_kwargs:<EOL><INDENT>save_kwargs = {}<EOL><DEDENT>results = form.save(request=request, **save_kwargs)<EOL>return (True, results)<EOL><DEDENT><DEDENT>return (False, form)<EOL>
Optional:
=========

You can pass kwargs to the form save function in a 'save_kwargs' dict.


Example Usage:
==============

success, form = process_form(request, DiscussionForm, initial={
    'category':Category.objects.all()[0].id,
})
if success:
    return form # this is the return from the forms save method.

return template(request, 'talk/create_discussion.html', {
    'categories': Category.objects.all(),
    'form': form
})