mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
[soc2009/multidb] Added versionadded tags to custom model field docs. Patch from Russell Keith-Magee.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@11947 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
cac9b38b1a
commit
8a20a3e3fc
@ -290,6 +290,9 @@ Custom database types
|
|||||||
|
|
||||||
.. method:: db_type(self, connection)
|
.. 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`,
|
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.
|
taking into account the connection object, and the settings associated with it.
|
||||||
|
|
||||||
@ -426,6 +429,9 @@ Converting Python objects to query values
|
|||||||
|
|
||||||
.. method:: get_prep_value(self, value)
|
.. 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
|
This is the reverse of :meth:`to_python` when working with the
|
||||||
database backends (as opposed to serialization). The ``value``
|
database backends (as opposed to serialization). The ``value``
|
||||||
parameter is the current value of the model's attribute (a field has
|
parameter is the current value of the model's attribute (a field has
|
||||||
@ -451,6 +457,9 @@ Converting query values to database values
|
|||||||
|
|
||||||
.. method:: get_db_prep_value(self, value, connection, prepared=False)
|
.. 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
|
Some data types (for example, dates) need to be in a specific format
|
||||||
before they can be used by a database backend.
|
before they can be used by a database backend.
|
||||||
:meth:`get_db_prep_value` is the method where those conversions should
|
:meth:`get_db_prep_value` is the method where those conversions should
|
||||||
@ -467,6 +476,9 @@ processing.
|
|||||||
|
|
||||||
.. method:: get_db_prep_save(self, value, connection)
|
.. 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
|
Same as the above, but called when the Field value must be *saved* to
|
||||||
the database. As the default implementation just calls
|
the database. As the default implementation just calls
|
||||||
``get_db_prep_value``, you shouldn't need to implement this method
|
``get_db_prep_value``, you shouldn't need to implement this method
|
||||||
@ -505,6 +517,9 @@ two phase process.
|
|||||||
|
|
||||||
.. method:: get_prep_lookup(self, lookup_type, value)
|
.. 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,
|
:meth:`get_prep_lookup` performs the first phase of lookup preparation,
|
||||||
performing generic data validity checks
|
performing generic data validity checks
|
||||||
|
|
||||||
@ -553,6 +568,9 @@ accepted lookup types to ``exact`` and ``in``::
|
|||||||
|
|
||||||
.. method:: get_db_prep_lookup(self, lookup_type, value, connection, prepared=False)
|
.. 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.
|
Performs any database-specific data conversions required by a lookup.
|
||||||
As with :meth:`get_db_prep_value`, the specific connection that will
|
As with :meth:`get_db_prep_value`, the specific connection that will
|
||||||
be used for the query is passed as the ``connection`` parameter.
|
be used for the query is passed as the ``connection`` parameter.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user