mirror of
https://github.com/django/django.git
synced 2025-10-25 22:56:12 +00:00
magic-removal: Refs 1219 -- Added DELETE_ALL=True safety mechanism to prevent accidental deletion of entire table contents.
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2047 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -210,6 +210,15 @@ AttributeError: Manager isn't accessible via Article instances
|
||||
>>> Article.objects.get_count()
|
||||
4L
|
||||
|
||||
>>> Article.objects.delete()
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: SAFTEY MECHANISM: Specify DELETE_ALL=True if you actually want to delete all data
|
||||
|
||||
>>> Article.objects.delete(DELETE_ALL=True)
|
||||
>>> Article.objects.get_count()
|
||||
0L
|
||||
|
||||
"""
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
Reference in New Issue
Block a user