diff --git a/docs/howto/custom-model-fields.txt b/docs/howto/custom-model-fields.txt index 1da8eae4b1..169f5114b8 100644 --- a/docs/howto/custom-model-fields.txt +++ b/docs/howto/custom-model-fields.txt @@ -458,7 +458,7 @@ 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. + 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. diff --git a/docs/topics/db/multi-db.txt b/docs/topics/db/multi-db.txt index 2e848f3430..8c42613ebb 100644 --- a/docs/topics/db/multi-db.txt +++ b/docs/topics/db/multi-db.txt @@ -28,7 +28,9 @@ whatever alias you choose. The following is an example ``settings.py`` snippet defining two databases - a default Postgres database, and a MySQL database called -``users``:: +``users``: + +.. code-block:: python DATABASES = { 'default': { @@ -56,7 +58,9 @@ It is possible to select the database for a ``QuerySet`` at any point during it's construction. To choose the database that a query will be preformed against simply call the ``using()`` method on the ``QuerySet``. ``using()`` takes a single argument: the alias of the -database on which you want to run the query. For example:: +database on which you want to run the query. For example: + +.. code-block:: python # This will run on the 'default' database... >>> Author.objects.all()