问题描述
嗨,美好的一天,我目前正在关注 Django-MPTT 文档,但我在使用升序 = True 时遇到了问题。这是我的代码:
views.py
def show_genres(request):
Try01 = Genre.objects.filter(name="Rock")
context = {'genres': Genre.objects.all(),'sample_ancestor': Try01.get_ancestors(ascending=True,include_self=True)}
return render(request,"sampletemp/startup.html",context)
当我使用 Ascending=True 时,会出现错误提示:
Exception Value: get_queryset_ancestors() got an unexpected keyword argument 'ascending'
我该如何解决。提前致谢!