How to remove all of the data in a table using Django

后端 未结 8 1780
执笔经年
执笔经年 2020-12-12 21:12

I have two questions:

  1. How do I delete a table in Django?
  2. How do I remove all the data in the table?

This is my code, which is not succe

8条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-12 22:08

    As per the latest documentation, the correct method to call would be:

    Reporter.objects.all().delete()
    

提交回复
热议问题