1
0
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:
Russell Keith-Magee
2006-01-18 13:16:58 +00:00
parent c2d468095d
commit 186c09d96f
2 changed files with 19 additions and 1 deletions

View File

@@ -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