RE: Form_for multiple models

2007-07-24 Thread Chris Brand
> You can specify it upon form creation. Here is an example of how you > could use prefixes for multiple model forms: Thanks, Nathan. That's very useful. Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

Re: Form_for multiple models

2007-07-24 Thread Nathan Ostgard
You can specify it upon form creation. Here is an example of how you could use prefixes for multiple model forms: In your views: from django import newforms as forms from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from yourproject.yourapp.models impor

RE: Form_for multiple models

2007-07-24 Thread Chris Brand
> - 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 bette

Re: Form_for multiple models

2007-07-24 Thread Chris Hoeppner
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 contex

Re: Form_for multiple models

2007-07-24 Thread Russell Keith-Magee
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 s