Howdy --

edit_inline seems to be doing something funky when I use it through
update_object generic view.  I've got a model that looks something like
this:

class StationEvent(models.Model):
    date = models.DateTimeField()
    description = models.CharField(maxlength = 150)
    class Admin:
        pass

class StationEventParticipant(models.Model):
    event = models.ForeignKey(StationEvent,edit_inline=models.TABULAR)
    participant = models.ForeignKey(Member, core=True)

The relevant part of the template is:
{% for p in form.stationeventparticipant %}
<tr>
        <td>
                <label for='id_participant.{{ forloop.counter0
}}.participant'>Participant: </label>
        </td>
        <td>
                {{ p.participant }}
        </td>
        <td>
                {% for e in p.errors %} {{ e }} {% endfor %}
        </td>
</tr>
{% endfor %}

At first glance it appears to be working -- the update_oject view for
StationEvent lists its fields and a field for a participant.  But when
it's actually saved, what happens is that for each participant listed,
it will create a new StationEventParticipant object whether or not it
already existed.  So every time I come back after saving the list of
participants doubles!

All of this machinery works fine in the django dupplied admin
interface, so I'm guessing it's something I'm doing wrong.  Any help
would be awesome!  Apologies if this is a common issue, but a search
through the mailing list doesn't indicate anyone has had this problem.

-- John


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

Reply via email to