1
我正在嘗試爲我的django項目實現樹狀註釋。每條評論都可以回覆並保存爲給定的評論子。django中的樹狀註釋
comment 1
|- reply 1 to comment 1
|- reply 2 to comment 1
|- reply 3 to comment 1
|- reply 1 to reply 3 to comment 1
|- reply 2 to reply 3 to comment 1
comment 2
|- reply 1 to comment 2
... and so on ...
這裏是我的模型:
class Comment(models.Model):
author = models.ForeignKey(User)
parent = models.ForeignKey(Comment, blank=True) #
text = models.TextField()
created = models.DateTimeField()
updated = models.DateTimeField(blank=True)
這是要走的路,還是我重新發明輪子?我敢肯定,這是典型的案例,所以有內建的解決方案?謝謝。
從disqus開發商,當計數評論極端得到一個有趣的文章:http://justcramer.com/2010/05/30/scaling-threaded-comments- on-django-at-disqus/ – Ski 2011-02-24 21:40:38
看起來這個鏈接不再起作用,這看起來像你正在鏈接的東西? https://github.com/HonzaKral/django-threadedcomments – Maus 2012-10-14 17:57:31