hi all,
I've used the generic view 'update_object' to modify a class with a
ForeignKey() ... the urls.py:
(r'^confs/(?P<object_id>\d+)/$', \
'django.views.generic.create_update.update_object', \
{ 'model': Conferma, 'login_required': True }),
the models.py:
class DatiConf(models.Model):
fk_conf = models.ForeignKey(Conferma, edit_inline = models.TABULAR)
....
in conferma_form.html
{% if form.daticonf %}
<fieldset class="module">
<h2>Dati Conferma</h2>
<table>
<tr>
<td>Comandante</td>
<td>Ora disormeggio</td>
</tr>
{% for x in form.daticonf %}
<tr>
<td>
{{ x.com }}
{% if x.com.errors %}
<p class="error">{{ x.com.errors|join:", " }}</p>
{% endif %}
</td>
...
the problem: when I save the form ALWAYS the inline data are duplicated ...
if in the first form there are 2 inline objects, in the second I found 4
inline objects and so on ...
can someone help me ??
tanks in advance ...
--
#include <stdio.h>
int main(void){char c[]={10,65,110,116,111,110,105,111,32,98,97,114,98,111,110,
101,32,60,104,105,110,100,101,109,105,116,64,116,105,115,99,97,108,105,110,101,
116,46,105,116,62,10,10,0};printf("%s",c);return 0;}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---