﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
7235	filtering on an EmptyQuerySet raises an Exception	anonymous	aljosa	"Trying to filter an instance of EmptyQuerySet causes an Exception to be raised:

{{{
>>> from django.db.models.query import *
>>> q = EmptyQuerySet()
>>> q.filter(x=10)
Traceback (most recent call last):
  File ""<console>"", line 1, in <module>
  File ""/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/db/models/query.py"", line 370, in filter
    return self._filter_or_exclude(False, *args, **kwargs)
  File ""/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/db/models/query.py"", line 388, in _filter_or_exclude
    clone.query.add_q(Q(*args, **kwargs))
  File ""/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/db/models/sql/query.py"", line 1068, in add_q
    can_reuse=used_aliases)
  File ""/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/db/models/sql/query.py"", line 954, in add_filter
    opts = self.get_meta()
  File ""/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/db/models/sql/query.py"", line 127, in get_meta
    return self.model._meta
AttributeError: 'NoneType' object has no attribute '_meta'
>>> 
}}}

I would think that no matter what you pass in as arguments to filter(), it should always return EmptyQuerySet."		closed	Database layer (models, ORM)	dev		fixed	qsrf-cleanup query,emptyqueryset		Accepted	1	0	0	0	0	0
