Hi,

On Sun, Jul 5, 2009 at 11:42 PM, Eric Abrahamsen<gir...@gmail.com> wrote:
>
> I'm somehow failing to use modelformsets, this is the relevant view
> and error traceback:
>
> http://dpaste.org/evHq/
>
> I'm validating a whole bunch of forms at the same time, but I don't
> see how that could cause the formset failure. Sample is a model with a
> ForeignKey to Author (though the ForeignKey field itself is called
> 'translator', stupid naming practice). I'm hoping there's something
> obviously wrong with what I'm doing there, but I can provide more
> details if necessary...
>


It seems that the modelformset code cannot find the primary key values
in the POST request. You need to include the primary key hidden field
in your form code, otherwise it will not work; something like this:

{% for form in formset %}
   {{ form.id }}
   {# the rest of your code #}
{% endfor %}


I don't recall whether this is documented or not. This approach worked
for me, though.



Matthias

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