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 ProfileForm(models.ModelForm):
    class Meta:
        model = Profile
    first_name = models.CharField()
    last_name = models.CharField()
    email = models.EmailField()

And then I use form.save(commit=False) and work with the extra data...
Is is the better way? I read about inlineformset_factory but I can't
figure out if it is better for my case.

Any help will be appreciatted!
Best regards,
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to