Russell Keith-Magee escribió:
> On 7/24/07, Chris Hoeppner <[EMAIL PROTECTED]> wrote:
> 
>> Well... Actually, what I need is the same as form_for_instance, but for
>> more than a single model.
> 
> Why not use multiple forms? There is nothing stopping you from putting
> multiple forms into a context, and populating multiple forms from a
> single POST dictionary. The only things to keep in mind are:
> 
>  - remember to check validity for both forms (form1.is_valid() and
> form2.is_valid())
> 
>  - When you instantiate your form, pass in prefix='form1' as an
> argument - all the fields on the form will get that prefix, which will
> keep the two forms distinct in the POST dictionary. This will only be
> an issue if there is an overlap in the field names on the two forms,
> but it's better to be safe.
> 
> Yours,
> Russ Magee %-)
> 

If I get this right, I might just throw fields from different models
together in one <form>, and on the server side, call the save() method
on each form instance, and all the data gets where it belongs to?

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to