mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #11116 -- Corrected the deletion of proxy objects. Thanks to Samuel Adam for the fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10824 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b9b9ca334e
commit
2e24596001
2 changed files with 10 additions and 1 deletions
|
@ -276,6 +276,15 @@ True
|
|||
>>> UserProxyProxy.objects.all()
|
||||
[<UserProxyProxy: Bruce>]
|
||||
|
||||
# Proxy objects can be deleted
|
||||
>>> u2 = UserProxy.objects.create(name='George')
|
||||
>>> UserProxy.objects.all()
|
||||
[<UserProxy: Bruce>, <UserProxy: George>]
|
||||
>>> u2.delete()
|
||||
>>> UserProxy.objects.all()
|
||||
[<UserProxy: Bruce>]
|
||||
|
||||
|
||||
# We can still use `select_related()` to include related models in our querysets.
|
||||
>>> country = Country.objects.create(name='Australia')
|
||||
>>> state = State.objects.create(name='New South Wales', country=country)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue