I’m currently actively trying to figure out which of django-mptt or django-treebeard can best handle being applied for reddit-like comments. Specifically I am talking about the Materialized Path trees in django-treebeard vs django-mptt.
The key question for me is which library is best able to handle things like e.g. sorting comments by ‘Newest’, ‘Oldest’, ‘Highest Vote Score’, etc.
For the Materialized Path implemntation with django-treebeard, because the path is set upon insert, it seems really difficult to be able to dynamically resort the comments according to their vote score (which is liable to change sporadically). Is this even possible with django treebeard?
I’m really trying to make django-treebeard work because using Materialized Paths is supposed to be the better, faster option (django-cms and wagtail both moved to django-treebeard), but I just have no idea how to implement dynamically sorted comments with it or if it’s even possible.
Currently the materialized path that is built corresponds to being sorted by newest. But how is it possible to create a path sorted by score, if the path is determined on insert?
So maybe to rephrase my question, Are the osteniible benefits of Materialized Paths (fast reads, fastish writes) worth the monkeywrenching that’s required with django-treebeard (for the most part because of spurious documentation for this particular use case [good documentation otherwise]) vs just using full-batteried but probably slower django-mptt?
The main problem with django treebeard is it denormalizes the relationship between parent and child, so resorting the tree is an extra headache.