Re: form_for_instance-like behaviour for customising ModelForm

2008-02-25 Thread Jacob Kaplan-Moss
On 2/25/08, konryd <[EMAIL PROTECTED]> wrote: > The modelforms, however, don't have that feature. I nees to set the > instance, or the initial data every time I instanciate a form. Or, if you've always got the same initial object, simply override __init__ to work the way you'd like. For example

form_for_instance-like behaviour for customising ModelForm

2008-02-25 Thread konryd
I really liked the two, now deprecated, methods (form_for_model and form_for_instance) for working with newforms. I could reuse the dead- simple logic (if post: validate and save else: display once again) and pass the generated Form class in both add and edit. Let me show you: def processForm(Pro