Commit ab908685 authored by Russell Keith-Magee's avatar Russell Keith-Magee
Browse files

Fixed #13739 -- Updated release notes to make a note of the changes to Field.db_type.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13350 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 2597f31e
Loading
Loading
Loading
Loading
+19 −14
Original line number Diff line number Diff line
@@ -435,6 +435,8 @@ database-compatible values. A custom field might look something like::

    class CustomModelField(models.Field):
        # ...
        def db_type(self):
            # ...

        def get_db_prep_save(self, value):
            # ...
@@ -451,6 +453,9 @@ two extra methods have been introduced::
    class CustomModelField(models.Field):
        # ...

        def db_type(self, connection):
            # ...

        def get_prep_value(self, value):
            # ...

@@ -467,10 +472,10 @@ two extra methods have been introduced::
            # ...

These changes are required to support multiple databases --
``get_db_prep_*`` can no longer make any assumptions regarding the
database for which it is preparing. The ``connection`` argument now
provides the preparation methods with the specific connection for
which the value is being prepared.
``db_type`` and ``get_db_prep_*`` can no longer make any assumptions
regarding the database for which it is preparing. The ``connection``
argument now provides the preparation methods with the specific
connection for which the value is being prepared.

The two new methods exist to differentiate general data-preparation
requirements from requirements that are database-specific. The