diff options
| author | Anssi Kääriäinen <akaariai@gmail.com> | 2014-12-01 09:28:01 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-01-08 14:07:54 -0500 |
| commit | 0c7633178fa9410f102e4708cef979b873bccb76 (patch) | |
| tree | cd46a196f4066f5759623ccb1ede096c5806a414 /django/db/backends/__init__.py | |
| parent | b8abfe141be17f20079f55b921dcaf7abe116c4b (diff) | |
Fixed #24020 -- Refactored SQL compiler to use expressions
Refactored compiler SELECT, GROUP BY and ORDER BY generation.
While there, also refactored select_related() implementation
(get_cached_row() and get_klass_info() are now gone!).
Made get_db_converters() method work on expressions instead of
internal_type. This allows the backend converters to target
specific expressions if need be.
Added query.context, this can be used to set per-query state.
Also changed the signature of database converters. They now accept
context as an argument.
Diffstat (limited to 'django/db/backends/__init__.py')
| -rw-r--r-- | django/db/backends/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py index 3c99819218..6c675cb482 100644 --- a/django/db/backends/__init__.py +++ b/django/db/backends/__init__.py @@ -1262,7 +1262,7 @@ class BaseDatabaseOperations(object): second = timezone.make_aware(second, tz) return [first, second] - def get_db_converters(self, internal_type): + def get_db_converters(self, expression): """Get a list of functions needed to convert field data. Some field types on some backends do not provide data in the correct @@ -1270,7 +1270,7 @@ class BaseDatabaseOperations(object): """ return [] - def convert_durationfield_value(self, value, field): + def convert_durationfield_value(self, value, expression, context): if value is not None: value = str(decimal.Decimal(value) / decimal.Decimal(1000000)) value = parse_duration(value) |
