1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

Fixed #9307 -- Added the ability to pickle the Query class used by the Oracle

backend.

This allows Querysets to be cached for Oracle and should provide a model for
adding pickling support to other (external) database backends that need a
custom Query class.

Thanks to Justin Bronn for some assistance with this patch.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9272 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2008-10-24 09:36:22 +00:00
parent 03fcf19fd2
commit 3dfbaae32b
2 changed files with 31 additions and 3 deletions

View File

@@ -27,9 +27,9 @@ try:
except NameError:
from sets import Set as set # Python 2.3 fallback
__all__ = ['Query']
__all__ = ['Query', 'BaseQuery']
class Query(object):
class BaseQuery(object):
"""
A single SQL query.
"""
@@ -1757,7 +1757,9 @@ class Query(object):
# Use the backend's custom Query class if it defines one. Otherwise, use the
# default.
if connection.features.uses_custom_query_class:
Query = connection.ops.query_class(Query)
Query = connection.ops.query_class(BaseQuery)
else:
Query = BaseQuery
def get_order_dir(field, default='ASC'):
"""