Ticket #2264: 2264.diff
File 2264.diff, 843 bytes (added by , 18 years ago) |
---|
-
docs/db-api.txt
1621 1621 1622 1622 Entry.objects.filter(pub_date__year=2005).delete() 1623 1623 1624 When Django deletes an object, it emulates the behavior of the SQL 1625 constraint ``ON DELETE CASCADE`` -- in other words, any objects which 1626 had foreign keys pointing at the object to be deleted will be deleted 1627 along with it. For example:: 1628 1629 b = Blog.objects.get(pk=1) 1630 # This will delete the Blog and all of its Entry objects. 1631 b.delete() 1632 1624 1633 Note that ``delete()`` is the only ``QuerySet`` method that is not exposed on a 1625 1634 ``Manager`` itself. This is a safety mechanism to prevent you from accidentally 1626 1635 requesting ``Entry.objects.delete()``, and deleting *all* the entries. If you