1
0
mirror of https://github.com/django/django.git synced 2025-07-06 18:59:13 +00:00

queryset-refactor: Fixed a bug in QuerySet.get(). Also removed unneeded code form EmptyQuerySet.

git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6484 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2007-10-14 02:11:47 +00:00
parent 7ebf3068c1
commit dfe7e4e925

View File

@ -146,7 +146,6 @@ class _QuerySet(object):
keyword arguments. keyword arguments.
""" """
clone = self.filter(*args, **kwargs) clone = self.filter(*args, **kwargs)
clone.query.clear_ordering()
obj_list = list(clone) obj_list = list(clone)
if len(obj_list) < 1: if len(obj_list) < 1:
raise self.model.DoesNotExist("%s matching query does not exist." raise self.model.DoesNotExist("%s matching query does not exist."
@ -501,6 +500,7 @@ class DateQuerySet(QuerySet):
c._order = self._order c._order = self._order
return c return c
# XXX; Everything below here is done.
class EmptyQuerySet(QuerySet): class EmptyQuerySet(QuerySet):
def __init__(self, model=None): def __init__(self, model=None):
super(EmptyQuerySet, self).__init__(model) super(EmptyQuerySet, self).__init__(model)
@ -517,9 +517,6 @@ class EmptyQuerySet(QuerySet):
c._result_cache = [] c._result_cache = []
return c return c
def _get_sql_clause(self):
raise EmptyResultSet
# QOperator, QAnd and QOr are temporarily retained for backwards compatibility. # QOperator, QAnd and QOr are temporarily retained for backwards compatibility.
# All the old functionality is now part of the 'Q' class. # All the old functionality is now part of the 'Q' class.
class QOperator(Q): class QOperator(Q):