show children nodes depending on selected parent

前端 未结 3 474
-上瘾入骨i
-上瘾入骨i 2021-02-10 16:51

Hi i\'ve been looking all over and can\'t find the answer to this. I have only 3 months experience in using python/django so excuse my dummy quesion! Im using django mptt to di

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-10 17:42

    You need to send down some information about what node you're in, and then it's a simple if statement.

    Regarding how to send down the node information universally, there are a couple ways to do this in Django, and none of them are perfect. My preferred method is context processors: http://docs.djangoproject.com/en/1.3/ref/templates/api/#writing-your-own-context-processors

提交回复
热议问题