Reputation: 397
I have a Django+Wagtail blog site integrated with django_comments_xtd
as below:
class PostDetail(Page):
...
class Comment(XtdComment):
page = models.ForeignKey('PostDetail', on_delete=models.CASCADE)
def save(self, *args, **kwargs):
if self.user:
self.user_name = self.user.username
self.page = PostDetail.objects.get(pk=self.object_pk)
super(Comment, self).save(*args, **kwargs)
Now I am about to create another class model class SurveyPoll(Page):
,
How can I apply the same Comment
to the newly-created model? Should I create another comment model ?
Upvotes: 0
Views: 44
Reputation: 11
You have many options for that, simplist and cleanest is to inherit from both (Page, Comment)
Upvotes: 0