Django Selective Dumpdata

后端 未结 4 1405
醉话见心
醉话见心 2021-02-01 13:31

Is it possible to selectively filter which records Django\'s dumpdata management command outputs? I have a few models, each with millions of rows, and I only want to dump record

4条回答
  •  被撕碎了的回忆
    2021-02-01 14:11

    This snippet might be helpful for you (it follows relationships and serializes them):

    http://djangosnippets.org/snippets/918/

    You could use also that management command and override the default managers for whichever models you would like to return custom querysets.

提交回复
热议问题