diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-10-24 09:40:12 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-10-24 09:40:12 +0000 |
| commit | 74c799d21d6682eb0a0ed8fa25dc48787d5bfb86 (patch) | |
| tree | d5eb1e65597681ed6c33116ac8f123cfdd11cc18 /django/db/models/sql | |
| parent | 0a1aafa581c211e7f970c0d9bbd0b1ae15577e57 (diff) | |
[1.0.X] 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.
Backport of r9272 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9273 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/sql')
| -rw-r--r-- | django/db/models/sql/query.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index ee63a0214f..3381b602b4 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -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'): """ |
