Management Commands¶
There are two management commands you can use with django-comments-xtd.
initialize_nested_count
¶
Since v2.8.0 there is a new attribute in the XtdComment
model: nested_count
. The attribute contains the number of comments nested under the comment instance.
If your project started using django-comments-xtd before v2.8.0 then you might want to feed nested_count
with the correct values. The command initialize_nested_comment
read your comments table and compute the correct value for nested_count
for every comment.
The command is idempotent, so it is safe to run it more than once over the same database.
An example:
$ python manage.py initialize_nested_count
populate_xtd_comments
¶
Management command populate_xtd_comments helps to start using django-comments-xtd when your project is based on django-comments.
Read the section Migrating to django-comments-xtd to know more about how to do the migration.