On Sep 2, 4:04 pm, flynnguy <[EMAIL PROTECTED]> wrote:
> Found out what was causing the error but not why...
>
> It seems that when I tell my model to not exclude the "pet" field,
> that everything works fine. (ie, I select a pet from the dropdown)
> When I add it to the exclude list and try to set it manually I get an
> error.
>
> What seems to work is allowing the pet selection but then setting it
> after I do save(commit=False). I'm trying to set it up as a hidden
> field but I keep getting that it's a required field. I can't seem to
> figure out how to set a default value. Any ideas why this might be
> happening?
> -Chris

You could try this;
 added_photo.pet_id = pet.id

That might work. Otherwise, try allowing null=True in the pet FK
field, and doing form.save() then adding the pet then saving again.
--
DR
--~--~---------~--~----~------------~-------~--~----~
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