Skip to content

Commit

Permalink
[soc2009/multidb] Added versionadded tags to custom model field docs.…
Browse files Browse the repository at this point in the history
… Patch from Russell Keith-Magee.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@11947 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
alex committed Dec 22, 2009
1 parent cac9b38 commit 8a20a3e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/howto/custom-model-fields.txt
Expand Up @@ -290,6 +290,9 @@ Custom database types

.. method:: db_type(self, connection)

.. versionadded:: 1.2
The ``connection`` argument was added to support multiple databases.

Returns the database column data type for the :class:`~django.db.models.Field`,
taking into account the connection object, and the settings associated with it.

Expand Down Expand Up @@ -426,6 +429,9 @@ Converting Python objects to query values

.. method:: get_prep_value(self, value)

.. versionadded:: 1.2
This method was factored out of ``get_db_prep_value()``

This is the reverse of :meth:`to_python` when working with the
database backends (as opposed to serialization). The ``value``
parameter is the current value of the model's attribute (a field has
Expand All @@ -451,6 +457,9 @@ Converting query values to database values

.. method:: get_db_prep_value(self, value, connection, prepared=False)

.. versionadded:: 1.2
The ``connection`` and ``prepared arguments were added to support multiple databases.

Some data types (for example, dates) need to be in a specific format
before they can be used by a database backend.
:meth:`get_db_prep_value` is the method where those conversions should
Expand All @@ -467,6 +476,9 @@ processing.

.. method:: get_db_prep_save(self, value, connection)

.. versionadded:: 1.2
The ``connection`` argument was added to support multiple databases.

Same as the above, but called when the Field value must be *saved* to
the database. As the default implementation just calls
``get_db_prep_value``, you shouldn't need to implement this method
Expand Down Expand Up @@ -505,6 +517,9 @@ two phase process.

.. method:: get_prep_lookup(self, lookup_type, value)

.. versionadded:: 1.2
This method was factored out of ``get_db_prep_lookup()``

:meth:`get_prep_lookup` performs the first phase of lookup preparation,
performing generic data validity checks

Expand Down Expand Up @@ -553,6 +568,9 @@ accepted lookup types to ``exact`` and ``in``::

.. method:: get_db_prep_lookup(self, lookup_type, value, connection, prepared=False)

.. versionadded:: 1.2
The ``connection`` and ``prepared`` arguments were added to support multiple databases.

Performs any database-specific data conversions required by a lookup.
As with :meth:`get_db_prep_value`, the specific connection that will
be used for the query is passed as the ``connection`` parameter.
Expand Down

0 comments on commit 8a20a3e

Please sign in to comment.