I used django-mptt version (0,5,'+dev')
My model looks like:
class Comment(MPTTModel):
content = models.CharField(max_length = 300)
parent = TreeForeignKey('self', null=True, blank=True, related_name='child')
class MPTTMeta:
order_insertion_by = ['-creation_time']
Now, I change Meta in Comment model:
class MPTTMeta:
order_insertion_by = ['creation_time']
then, I rebuild the tree under the django shell followed by THIS:
models.comment.tree.rebuild()
However, it throws:
AttributeError: type object 'Comment' has no attribute 'tree'
What's wrong with that? How to rebuild the tree in django-mptt?
Thanks!