Django转储单个模型的数据? - Django dump data for a single model?

问题:

Can I perform a dumpdata in Django on just a single model, rather than the whole app, and if so, how?我可以仅在单个模型上而不是整个应用程序中在Django中执行dumpdata吗?如果可以,如何执行?

For an app it would be:对于一个应用程序,它将是:

python manage.py dumpdata myapp

However, I want some specific model, such as "myapp.mymodel" to be dumped.但是,我希望转储某些特定的模型,例如“ myapp.mymodel”。 The reason being, I have some huge, 3 million records plus, datasets in the same app that I would not like dumped.原因是,在我不希望转储的同一应用程序中,我有300万条巨大的记录集。


解决方案:

参考一: https://en.stackoom.com/question/4fZA
参考二: https://stackoom.com/question/4fZA
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章