def _update(self, commit=False):
votes = Vote.objects.filter(<EOL>content_type    = self.get_content_type(),<EOL>object_id       = self.instance.pk,<EOL>key             = self.field.key,<EOL>)<EOL>obj_score = sum([v.score for v in votes])<EOL>obj_votes = len(votes)<EOL>score, created = Score.objects.get_or_create(<EOL>content_type    = self.get_content_type(),<EOL>object_id       = self.instance.pk,<EOL>key             = self.field.key,<EOL>defaults        = dict(<EOL>score       = obj_score,<EOL>votes       = obj_votes,<EOL>)<EOL>)<EOL>if not created:<EOL><INDENT>score.score = obj_score<EOL>score.votes = obj_votes<EOL>score.save()<EOL><DEDENT>self.score = obj_score<EOL>self.votes = obj_votes<EOL>if commit:<EOL><INDENT>self.instance.save()<EOL><DEDENT>
Forces an update of this rating (useful for when Vote objects are removed).