From b61eab18f71f3afb36b3e8cb208a145046b3d8f6 Mon Sep 17 00:00:00 2001 From: Alexander Sosnovskiy Date: Fri, 13 Nov 2015 10:56:10 +0300 Subject: Fixed #13774 -- Added models.Field.rel_db_type(). --- docs/ref/models/fields.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'docs/ref/models') diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index e1b80d5fea..033ae14778 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -1701,7 +1701,8 @@ Field API reference where the arguments are interpolated from the field's ``__dict__``. - To map a ``Field`` to a database-specific type, Django exposes two methods: + To map a ``Field`` to a database-specific type, Django exposes several + methods: .. method:: get_internal_type() @@ -1717,6 +1718,16 @@ Field API reference See :ref:`custom-database-types` for usage in custom fields. + .. method:: rel_db_type(connection) + + .. versionadded:: 1.10 + + Returns the database column data type for fields such as ``ForeignKey`` + and ``OneToOneField`` that point to the :class:`Field`, taking + into account the ``connection``. + + See :ref:`custom-database-types` for usage in custom fields. + There are three main situations where Django needs to interact with the database backend and fields: -- cgit v1.3