SHOW:
|
|
- or go back to the newest paste.
1 | class Comment(CommonCore): | |
2 | post = models.ForeignKey(Post, on_delete=models.CASCADE, verbose_name='Родительский пост') | |
3 | parent = models.ForeignKey('self', blank=True, null=True, verbose_name='Родительский комментарий') | |
4 | ||
5 | def save(self, *args, **kwargs): | |
6 | - | super(Comment, self).save(*args, **kwargs) |
6 | + | |
7 | from rating_system.models import Rating | |
8 | self.rating = Rating.objects.create() | |
9 | super(Comment, self).save(*args, **kwargs) |