1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #12876 -- Corrected a problem with recursive relations under deepcopy. Thanks to elachuni for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12700 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2010-03-07 07:11:22 +00:00
parent 5beb5f7372
commit 3508a86ddf
2 changed files with 13 additions and 6 deletions

View File

@@ -263,6 +263,13 @@ FieldError: Cannot resolve keyword 'reporter_id' into field. Choices are: headli
>>> Reporter.objects.filter(article__reporter__exact=r).distinct()
[<Reporter: John Smith>]
# Regression for #12876 -- Model methods that include queries that
# recursive don't cause recursion depth problems under deepcopy.
>>> r.cached_query = Article.objects.filter(reporter=r)
>>> from copy import deepcopy
>>> deepcopy(r)
<Reporter: John Smith>
# Check that implied __exact also works.
>>> Reporter.objects.filter(article__reporter=r).distinct()
[<Reporter: John Smith>]