ModelForm, one form, two models

2008-09-10 Thread Michel Thadeu Sabchuk
Hi guys, What is the best way to work with 2 models on the same forms? Suppose I have the following case: class Profile(models.Models): user = models.ForeignKey(User) some_data = models.CharField() How can I add a profile and a user on the same form using ModelForm? I used to do: class

Re: ModelForm, one form, two models

2008-09-22 Thread diN0bot
Seems like Joseph's problem is typical for User/Profile work. Initially I used the same inheritance model as he does. Working with a single form in the view and template is a win for code re-use and simplicity. I looked into formsets but haven't gotten it to work with multiple model types. It se

Re: ModelForm, one form, two models

2008-09-22 Thread Joseph Kocherhans
On Mon, Sep 22, 2008 at 8:57 AM, diN0bot <[EMAIL PROTECTED]> wrote: > > Seems like Joseph's problem is typical for User/Profile work. > > Initially I used the same inheritance model as he does. Working with a > single form in the view and template is a win for code re-use and > simplicity. > > I l

Re: ModelForm, one form, two models

2008-09-10 Thread Joseph Kocherhans
On Wed, Sep 10, 2008 at 6:59 AM, Michel Thadeu Sabchuk <[EMAIL PROTECTED]> wrote: > > Hi guys, > > What is the best way to work with 2 models on the same forms? Suppose > I have the following case: > > class Profile(models.Models): >user = models.ForeignKey(User) >some_data = models.CharFi