Hi, Like in many projects i use User from auth and my own Profile model. Except i have several profiles so Profile just holds a generic FK relationship; And ProfileFoo model has also a user Fk pointing back to User (its cleaner than using the generic reverse realtion which gives back a list)
If i need to create a form which will edit/save fields for ProfileFoo and Basic User fiedls what is the right way to do ? For now i do as follow: Forms: A BasicProfileForm model Form with firstname, lastname and email fields. A ProfileFooForm inheriting from BasicProfileForm and adding some of his own fields (using Meta) View: # We will look at the update case form = ProfileForm(instance=myprofile) And in my form i intercept the instance as follow: def __init__(self, *args, **kwargs): super(ProfileFooForm, self).__init__(*args, **kwargs) if kwargs.has_key('instance'): profileFoo = kwargs['instance'] self.fields['bla'].initial = profileFoo.user.bla self.fields['bli'].initial = profileFoo.user.bli It works well, but woudnt it be possible to do it more cleanly ? Thanks, Greg --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---