On Tue, Aug 09, 2011 at 08:53:07AM -0700, brian wrote: > I've created a form with Model->ModelForm flow. Django is running on > a sub-domain and I'm putting separate instances of the form on > multiple php websites via iframe. > > How can I use the same form model but have independent forms? > > For example I want: > form1 to be at: example.com/form1 > form2 to be at: example.com/form2 > > form1 admin to be at: example.com/form1Admin > form2 admin to be at: example.com/form2Admin > > I want form1 and form2 to use the same model but act independent of > each other. For example I want form1 data to only be present in > form1Admin. I believe I can add options in the url.py file for the > different forms but I'm not sure how specify keeping the data separate > in the database and setup the admin page.
I'd probably add an extra field, maybe IntegerField or something to the model, exclude it in both ModelForms and ModelAdmins and define two distinct constants. Then provide the default predefined value in both ModelForms and ModelAdmins and specify corresponding QuerySets as needed. If you need any more details, just ask. Michal
signature.asc
Description: Digital signature