diff options
Diffstat (limited to 'django/db/backends/base/operations.py')
| -rw-r--r-- | django/db/backends/base/operations.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/django/db/backends/base/operations.py b/django/db/backends/base/operations.py index c4e78e719e..24bcbb3d08 100644 --- a/django/db/backends/base/operations.py +++ b/django/db/backends/base/operations.py @@ -219,7 +219,7 @@ class BaseDatabaseOperations(object): """ return cursor.lastrowid - def lookup_cast(self, lookup_type): + def lookup_cast(self, lookup_type, internal_type=None): """ Returns the string to use in a query when performing lookups ("contains", "like", etc). The resulting string should contain a '%s' @@ -442,7 +442,7 @@ class BaseDatabaseOperations(object): def value_to_db_date(self, value): """ - Transform a date value to an object compatible with what is expected + Transforms a date value to an object compatible with what is expected by the backend driver for date columns. """ if value is None: @@ -451,7 +451,7 @@ class BaseDatabaseOperations(object): def value_to_db_datetime(self, value): """ - Transform a datetime value to an object compatible with what is expected + Transforms a datetime value to an object compatible with what is expected by the backend driver for datetime columns. """ if value is None: @@ -460,7 +460,7 @@ class BaseDatabaseOperations(object): def value_to_db_time(self, value): """ - Transform a time value to an object compatible with what is expected + Transforms a time value to an object compatible with what is expected by the backend driver for time columns. """ if value is None: @@ -471,11 +471,18 @@ class BaseDatabaseOperations(object): def value_to_db_decimal(self, value, max_digits, decimal_places): """ - Transform a decimal.Decimal value to an object compatible with what is + Transforms a decimal.Decimal value to an object compatible with what is expected by the backend driver for decimal (numeric) columns. """ return utils.format_number(value, max_digits, decimal_places) + def value_to_db_ipaddress(self, value): + """ + Transforms a string representation of an IP address into the expected + type for the backend driver. + """ + return value + def year_lookup_bounds_for_date_field(self, value): """ Returns a two-elements list with the lower and upper bound to be used |
