1

我无法使用 django 评论将评论拉入我的模板。我想在外壳中测试一些东西 - 即。拉入一个对象并获得一组评论 - 但我不知道该怎么做。

是否可以在 shell 中访问模型的评论?

4

1 回答 1

1
python manage.py shell
from django.contrib.comments import Comment

c = Comment.objects.filter(...)

...
于 2012-01-27T21:05:58.527 回答