diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-08-28 05:00:23 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-08-28 05:00:23 +0000 |
| commit | 4cd03ef5d985a76236d47c4fd9c041531722e6c0 (patch) | |
| tree | 51fcd1876e7e2913ac1728d492a0393a60a98061 /tests | |
| parent | 1abfb1df19d7a5722a190cb9988e27fc729bb788 (diff) | |
Improvements to [8608] to fix an infinite loop (for exclude(generic_relation)).
Also comes with approximately 67% less stupidity in the table joins for
filtering on generic relations.
Fixed #5937, hopefully for good, this time.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8644 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/modeltests/generic_relations/models.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/modeltests/generic_relations/models.py b/tests/modeltests/generic_relations/models.py index a8e3577a2d..bd8478f534 100644 --- a/tests/modeltests/generic_relations/models.py +++ b/tests/modeltests/generic_relations/models.py @@ -131,8 +131,12 @@ __test__ = {'API_TESTS':""" [<TaggedItem: clearish>] # Queries across generic relations respect the content types. Even though there are two TaggedItems with a tag of "fatty", this query only pulls out the one with the content type related to Animals. +>>> Animal.objects.order_by('common_name') +[<Animal: Lion>, <Animal: Platypus>] >>> Animal.objects.filter(tags__tag='fatty') [<Animal: Platypus>] +>>> Animal.objects.exclude(tags__tag='fatty') +[<Animal: Lion>] # If you delete an object with an explicit Generic relation, the related # objects are deleted when the source object is deleted. |
