Hi all, I solved it out.. I got a good tutorial on it, from James Bennett: http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/
@bruno: If this(http://dpaste.de/ODOJ/) was not enough for you, ... @Gladys: Thanks for your time. regards, atm ___ Life is short, Live it hard. On 13 March 2011 21:40, gladys bixly <gladysbi...@gmail.com> wrote: > 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 < > bruno.desthuilli...@gmail.com> wrote: > >> >> >> On 11 mar, 07:58, Anoop Thomas Mathew <atm...@gmail.com> 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 django-users@googlegroups.com. >> To unsubscribe from this group, send email to >> django-users+unsubscr...@googlegroups.com. >> 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 django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.