I'm using Swampdragon to provide real time updates to the system since I 
don't want users to keep refreshing their page to get them. I used the
*ModelPublisherRouter* which causes me to get any updates to a particular 
model. 

I currently have an Events model with the following attributes:
class Event(SelfPublishModel, models.Model):
    serializer_class = EventSerializer
    name = models.CharField(max_length=250)
    description = models.CharField(max_length=250)
    location = models.CharField(max_length=250)
    privacy = models.CharField(max_length=250)
    startDate = models.DateField()
    endDate = models.DateField()
    allDay = models.BooleanField(default=False)
    noOfAttendees = models.IntegerField(default=0)
    noOfNonAttendees = models.IntegerField(default=0)
    noOfInvitees = models.IntegerField(default=0)
    eventOwner = models.ForeignKey(User, related_name='eventsOwned')
    eventInvitees = models.ManyToManyField(User, 
related_name='eventInvitees')
    eventAttendees = models.ManyToManyField(User, 
related_name='eventAttendees')
    eventNonAttendees = models.ManyToManyField(User, 
related_name='eventNonAttendees')

As you can see, there are three many to many relationships with the User 
table. If I edit an event's name and description without doing any 
changes to eventInvitees, eventAttendees or eventNonAttendees, I was 
expecting just one "publish" from Swampdragon since there is a change
in the Events row. However, it "publishes" the update, 6 more times and I 
suspect it is because of the rows in the join tables as it does not publish
6 times when I comment out these relationships. 

I then checked the join tables and every time I do an update through the 
admin UI, even if I did not add or remove users, it changes the primary key 
of the rows, causing the publish from Swampdragon to be done. Is there any 
way I can avoid having the IDs change?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/af69c846-ece7-4af4-ab0f-344a1f49f390%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to