Ticket #11116: 11116_model_proxy_delete_with_test.diff
File 11116_model_proxy_delete_with_test.diff, 1.2 KB (added by , 16 years ago) |
---|
-
django/db/models/base.py
538 538 # traversing to the most remote parent classes -- those with no parents 539 539 # themselves -- and then adding those instances to the collection. That 540 540 # will include all the child instances down to "self". 541 parent_stack = self._meta.parents.values()541 parent_stack = filter(None, self._meta.parents.values()) 542 542 while parent_stack: 543 543 link = parent_stack.pop() 544 544 parent_obj = getattr(self, link.name) -
tests/modeltests/proxy_models/models.py
275 275 [<UserProxy: Bruce>] 276 276 >>> UserProxyProxy.objects.all() 277 277 [<UserProxyProxy: Bruce>] 278 >>> u2 = UserProxy.objects.create(name='Try to delete me') 279 >>> u2.delete() 278 280 279 281 # We can still use `select_related()` to include related models in our querysets. 280 282 >>> country = Country.objects.create(name='Australia')