If you look at this code:

class Profileform(forms.ModelForm):
        class Meta:
                model = User
                fields = ('first_name','last_name','email',)
                class Employeeform(forms.ModelForm):
    """self explanatory"""
    class Meta(Profileform):
        model = Profile
        exclude = ('user',)


Your Profileform is associated with the User model.
Now your Employeeform, I assume, you want to associate with the Profile
model. But why did you have to inherit the Meta from Profileform with this
line "Class Meta(Profileform)"? Do you want to override it?



On Fri, Mar 11, 2011 at 6:16 PM, bruno desthuilliers <
[email protected]> wrote:

>
>
> On 11 mar, 07:58, Anoop Thomas Mathew <[email protected]> wrote:
> > Hi all,
> >
> > I have a Profile model, which has a ForiegnKey to User model. I want to
> edit
> > both of it at same form.
> >
> > this is what I tried,http://dpaste.de/ODOJ/
> > Still, no success. Please help.
>
> You'll have to provide a bit more informations if you hope to get some
> help - like, what "no success" means *exactly*
>
> Now just for the record, chances are your Profile.id is not the same
> as User.id so there's probably something wrong with your view.
>
> Also and FWIW, I had the same need (editing user and profile fields in
> a same form) in a couple apps, and always ended up writing my own (non-
> model) form. ModelForms are quite handy, but it's sometimes easier and
> quicker to write a custom form instead.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to [email protected].
> 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.
>
>


-- 
Gladys
http://bixly.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
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