def save(self, *args, **kwargs):
if not self.pk:<EOL><INDENT>old_ratings = Rating.objects.filter(user=self.user, node=self.node)<EOL>for old_rating in old_ratings:<EOL><INDENT>old_rating.delete()<EOL><DEDENT><DEDENT>super(Rating, self).save(*args, **kwargs)<EOL>
ensure users cannot rate the same node multiple times
but let users change their rating