Ticket #17338: supports-deleting-related.patch

File supports-deleting-related.patch, 1.3 KB (added by Jonas H., 12 years ago)
  • django/db/backends/__init__.py

    commit acd9e5dd525a3a0701bc30ee2b8caf04130e0ca6
    Author: Jonas Haag <jonas@lophus.org>
    Date:   Wed Sep 28 21:48:57 2011 +0200
    
        supports_deleting_related_objects
    
    diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
    index 588646f..215c97f 100644
    a b class BaseDatabaseFeatures(object):  
    314314    has_select_for_update_nowait = False
    315315
    316316    supports_select_related = True
     317    supports_deleting_related_objects = True
    317318
    318319    # Does the default test database allow multiple connections?
    319320    # Usually an indication that the test database is in-memory
  • django/db/models/deletion.py

    diff --git a/django/db/models/deletion.py b/django/db/models/deletion.py
    index 9a6d499..7044b9e 100644
    a b class Collector(object):  
    140140        models, the one case in which the cascade follows the forwards
    141141        direction of an FK rather than the reverse direction.)
    142142        """
     143        if not connections[self.using].features.supports_deleting_related_objects:
     144            collect_related = False
     145
    143146        new_objs = self.add(objs, source, nullable,
    144147                            reverse_dependency=reverse_dependency)
    145148        if not new_objs:
Back to Top