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:
@@ -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>]
|
||||
|
||||
Reference in New Issue
Block a user