Skip to content

dump_bulk alternative for django-treenode #89

Closed Answered by fabiocaccamo
baseplate-admin asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @baseplate-admin
you can try to use the model class method to obtain a n-dimensional dict representing the model tree:

YourModelClass.get_tree()

Alternatively, if you need to have more control on the desired output, you could:

  1. Use Django dumpdata command to output a flat json of all nodes
  2. Use python-benedict for loading the .json and building the dict tree with two lines of code (using the nest method)

I hope to have been helpful.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
6 replies
@fabiocaccamo
Comment options

@baseplate-admin
Comment options

@fabiocaccamo
Comment options

@baseplate-admin
Comment options

@fabiocaccamo
Comment options

Answer selected by baseplate-admin
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants