| | 973 | Bug #7235 -- an EmptyQuerySet should not raise exceptions if it is filtered. |
| | 974 | >>> q = EmptyQuerySet() |
| | 975 | >>> q.all() |
| | 976 | [] |
| | 977 | >>> q.filter(x=10) |
| | 978 | [] |
| | 979 | >>> q.exclude(y=3) |
| | 980 | [] |
| | 981 | >>> q.complex_filter({'pk': 1}) |
| | 982 | [] |
| | 983 | >>> q.select_related('spam', 'eggs') |
| | 984 | [] |
| | 985 | >>> q.annotate(Count('eggs')) |
| | 986 | [] |
| | 987 | >>> q.order_by('-pub_date', 'headline') |
| | 988 | [] |
| | 989 | >>> q.distinct() |
| | 990 | [] |
| | 991 | >>> q.extra(select={'is_recent': "pub_date > '2006-01-01'"}) |
| | 992 | [] |
| | 993 | >>> q.query.low_mark = 1 |
| | 994 | >>> q.extra(select={'is_recent': "pub_date > '2006-01-01'"}) |
| | 995 | Traceback (most recent call last): |
| | 996 | ... |
| | 997 | AssertionError: Cannot change a query once a slice has been taken |
| | 998 | >>> q.reverse() |
| | 999 | [] |
| | 1000 | >>> q.defer('spam', 'eggs') |
| | 1001 | [] |
| | 1002 | >>> q.only('spam', 'eggs') |
| | 1003 | [] |
| | 1004 | |