diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2006-05-06 00:26:24 +0000 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2006-05-06 00:26:24 +0000 |
| commit | f57e34e99038bf0834638e6690d04d3ca59cde81 (patch) | |
| tree | 977138ec602a78ec141d8a5a9613157b51629691 /tests | |
| parent | 3f932e31dc4f1c4146ed42f7dc8ca7154b06481a (diff) | |
Fixed #1579 - added support for 'Q' objects in limit_choices_to.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2850 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/modeltests/or_lookups/models.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/modeltests/or_lookups/models.py b/tests/modeltests/or_lookups/models.py index 9d62a1266c..cd01447a35 100644 --- a/tests/modeltests/or_lookups/models.py +++ b/tests/modeltests/or_lookups/models.py @@ -86,4 +86,11 @@ Hello and goodbye >>> Article.objects.filter(Q(headline__startswith='Hello')).in_bulk([1,2]) {1: Hello} +# The 'complex_filter' method supports framework features such as +# 'limit_choices_to' which normally take a single dictionary of lookup arguments +# but need to support arbitrary queries via Q objects too. +>>> Article.objects.complex_filter({'pk': 1}) +[Hello] +>>> Article.objects.complex_filter(Q(pk=1) | Q(pk=2)) +[Hello, Goodbye] """ |
