def update_count(self):
node_rating_count = self.node.rating_count<EOL>node_rating_count.rating_count = self.node.rating_set.count()<EOL>node_rating_count.rating_avg = self.node.rating_set.aggregate(rate=Avg('<STR_LIT:value>'))['<STR_LIT>']<EOL>if node_rating_count.rating_avg is None:<EOL><INDENT>node_rating_count.rating_avg = <NUM_LIT:0><EOL><DEDENT>node_rating_count.save()<EOL>
updates rating count and rating average