summaryrefslogtreecommitdiff
path: root/django/db/backends/base/operations.py
diff options
context:
space:
mode:
authorJosh Smeaton <josh.smeaton@gmail.com>2015-01-17 16:03:46 +1100
committerJosh Smeaton <josh.smeaton@gmail.com>2015-01-27 12:20:06 +1100
commit8196e4bdf498acb05e6680c81f9d7bf700f4295c (patch)
treed7b8c51787581b4f9ead00686380bba89d678296 /django/db/backends/base/operations.py
parent511be35779a98427387d9aa4abacce01dedd7272 (diff)
downloaddjango-8196e4bdf498acb05e6680c81f9d7bf700f4295c.tar.gz
Fixed #24154 -- Backends can now check support for expressions
Diffstat (limited to 'django/db/backends/base/operations.py')
-rw-r--r--django/db/backends/base/operations.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/django/db/backends/base/operations.py b/django/db/backends/base/operations.py
index 09a6316376..50f6c93a07 100644
--- a/django/db/backends/base/operations.py
+++ b/django/db/backends/base/operations.py
@@ -1,12 +1,14 @@
import datetime
import decimal
from importlib import import_module
+import warnings
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends import utils
from django.utils import six, timezone
from django.utils.dateparse import parse_duration
+from django.utils.deprecation import RemovedInDjango21Warning
from django.utils.encoding import force_text
@@ -517,12 +519,20 @@ class BaseDatabaseOperations(object):
return value
def check_aggregate_support(self, aggregate_func):
- """Check that the backend supports the provided aggregate
+ warnings.warn(
+ "check_aggregate_support has been deprecated. Use "
+ "check_expression_support instead.",
+ RemovedInDjango21Warning, stacklevel=2)
+ return self.check_expression_support(aggregate_func)
- This is used on specific backends to rule out known aggregates
- that are known to have faulty implementations. If the named
- aggregate function has a known problem, the backend should
- raise NotImplementedError.
+ def check_expression_support(self, expression):
+ """
+ Check that the backend supports the provided expression.
+
+ This is used on specific backends to rule out known expressions
+ that have problematic or nonexistent implementations. If the
+ expression has a known problem, the backend should raise
+ NotImplementedError.
"""
pass