Serializing a tree in Django

后端 未结 2 461
一生所求
一生所求 2021-01-13 18:35

is there any simple way to serialize a tree given by a model such as the Category shown below?

I\'d like to get a json object like:

[ { \'name\': \'c         


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-13 19:22

    Maybe Tasypie or Django-Piston can help? If not you can have a look at their source code to get some hints on how to do this.

提交回复
热议问题