Pylons/pyramid_deform — pull request #17 by davidjb (2013-01-30 03:30:33+00:00)
Title: Add new prepare_form method for FormView

This method allows the possibility of instantiating the FormView as a means to obtaining an instance of the form it will create. This is useful in the situation where you have a dedicated FormView for a form and want to re-use the given form (and just the form) on another view. My specific use-case is rendering the form to display in multiple locations, but only process input on one view.

Rendering the entire FormView can be costly and likely will prove problematic as the __call__ method checks things like the request's POST, etc. This hook allows you to instead get just the form instance out via something like:

```
view = FormView(context, request) #class used as a dedicated view elsewhere
form = view.prepare_form()
...
```

So, this means that you are able to render or do something else with the form, and don't need to re-define the form configuration.