On 09.04.2009, at 08:18, Briel wrote:

>
> Hi.
> It seems like your error and your problem is not the same. The error
> is complaining about the get_object_or_404, not the profile thing. So
> changing that code won't actually do anything as it doesn't get that
> far.
>
Well, maybe not. I had the same error yesterday.
If you pass a model instance as the value dict, then you get the
exceptions he mentioned.

> ~Jakob
>
> On Apr 9, 3:55 am, codecowboy <guy.ja...@gmail.com> wrote:
>> I want to create a form that allows a user to edit his/her  
>> profile.  I
>> don't want to bind my form to a model because the form will involve
>> two different models.  Does anyone have any ideas.  I've read chapter
>> 7 in the Django Book but it only to a simple example that does not
>> help me.
>>
>> Here is what I have tried.
>>
>> s = get_object_or_404(Scientist, pk=7)
>> form = ScientistProfileForm(initial=s)
>>

have you tried making a dict with the keys being the fieldnames and  
the dict values should then be prepopulated in the fields.

adi


>> I've also tried.
>>
>> form = ScientistProfileForm(s)
>>
>> I always get the following error message.
>>
>> Caught an exception while rendering: 'Scientist' object has no
>> attribute 'get'
>>
>> Thanks in advance for any help.  If I figure this out then I will  
>> post
>> my solution in here in great detail for anyone else that needs it.
> 

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to