On 1/6/07, Robert <[EMAIL PROTECTED]> wrote:
            e = Entry(**form.clean_data)
            e.save()
[...]
I'm getting:
Invalid value: 'author' should be a <class
'newforms.book.models.Author'> instance, not a <type 'unicode'> error
message when submitting the form.

Hi Robert,

It's telling you that when you create your Entry object, the "author"
parameter needs to be an Author object, not a Unicode string. You'll
have to create or retrieve that Author object before you pass it to
the Entry constructor.

You mentioned form.create() has the same problem -- that's because
it's currently naive about foreign-key values. We should improve it so
that it handles foreign-key values properly.

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to