Answer the question
In order to leave comments, you need to log in
How to bind a comment model to itself?
Hello. Situation:
1) There is a forum topic model: ForumTheme
class ForumTheme(models.Model):
user_link = models.ForeignKey(User, on_delete=models.CASCADE, default=1)
forum_category = models.CharField(max_length=200)
title = models.CharField(max_length=200)
forum_text = models.TextField()
class ForumCom(models.Model):
forum_connect = models.ForeignKey(ForumTheme, on_delete=models.CASCADE, default=1)
user_link = models.ForeignKey(User, on_delete=models.CASCADE, default=1)
forumcom_body = models.TextField()
class ForumCom(models.Model):
forum_connect = models.ForeignKey(ForumTheme, on_delete=models.CASCADE, default=1)
user_link = models.ForeignKey(User, on_delete=models.CASCADE, default=1)
forumcom_body = models.TextField()
answer_connect = models.ForeignKey(ForumCom, on_delete=models.CASCADE, default=1)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question