This is an important message.'
+ msg = EmailMultiAlternatives(subject, text_content, from_email, to)
+ msg.attach_alternative(html_content, "text/html")
+ msg.send()
+
+By default, the MIME type of the ``body`` parameter in an ``EmailMessage`` is
+``"text/plain"``. It is good practice to leave this alone, because it
+guarantees that any recipient will be able to read the e-mail, regardless of
+their mail client. However, if you are confident that your recipients can
+handle an alternative content type, you can use the ``content_subtype``
+attribute on the ``EmailMessage`` class to change the main content type. The
+major type will always be ``"text"``, but you can change it to the subtype. For
+example::
+
+ msg = EmailMessage(subject, html_content, from_email, to)
+ msg.content_subtype = "html" # Main content is now text/html
+ msg.send()
+
+SMTP network connections
+------------------------
+
The ``SMTPConnection`` class is initialized with the host, port, username and
password for the SMTP server. If you don't specify one or more of those
options, they are read from your settings file.
diff --git a/docs/faq.txt b/docs/faq.txt
index d7d8f41146..67ed8a49a5 100644
--- a/docs/faq.txt
+++ b/docs/faq.txt
@@ -104,7 +104,7 @@ Lawrence, Kansas, USA.
`Wilson Miner`_
Wilson's design-fu makes us all look like rock stars. By day, he's an
- interactive designer for `Apple`. Don't ask him what he's working on, or
+ interactive designer for `Apple`_. Don't ask him what he's working on, or
he'll have to kill you. He lives in San Francisco.
On IRC, Wilson goes by ``wilsonian``.
diff --git a/docs/generic_views.txt b/docs/generic_views.txt
index 359a82506a..2b80348903 100644
--- a/docs/generic_views.txt
+++ b/docs/generic_views.txt
@@ -754,10 +754,10 @@ If the results are paginated, the context will contain these extra variables:
* ``previous``: The previous page number, as an integer. This is 1-based.
- * `last_on_page`: The number of the
+ * ``last_on_page``: The number of the
last result on the current page. This is 1-based.
- * `first_on_page`: The number of the
+ * ``first_on_page``: The number of the
first result on the current page. This is 1-based.
* ``pages``: The total number of pages, as an integer.
diff --git a/docs/install.txt b/docs/install.txt
index 99aad4e52d..e850e48955 100644
--- a/docs/install.txt
+++ b/docs/install.txt
@@ -48,7 +48,8 @@ Get your database running
If you plan to use Django's database API functionality, you'll need to
make sure a database server is running. Django works with PostgreSQL_,
-MySQL_ and SQLite_.
+MySQL_, Oracle_ and SQLite_ (the latter doesn't require a separate server to
+be running).
Additionally, you'll need to make sure your Python database bindings are
installed.
@@ -76,6 +77,7 @@ installed.
.. _pysqlite: http://initd.org/tracker/pysqlite
.. _MySQL backend: ../databases/
.. _cx_Oracle: http://www.python.net/crew/atuining/cx_Oracle/
+.. _Oracle: http://www.oracle.com/
Remove any old versions of Django
=================================
diff --git a/docs/legacy_databases.txt b/docs/legacy_databases.txt
index ca3927e52f..b87a661f90 100644
--- a/docs/legacy_databases.txt
+++ b/docs/legacy_databases.txt
@@ -18,7 +18,7 @@ You'll need to tell Django what your database connection parameters are, and
what the name of the database is. Do that by editing these settings in your
`settings file`_:
- * `DATABASE_NAME`
+ * `DATABASE_NAME`_
* `DATABASE_ENGINE`_
* `DATABASE_USER`_
* `DATABASE_PASSWORD`_
diff --git a/docs/model-api.txt b/docs/model-api.txt
index 074e5fec82..4b0bc0d238 100644
--- a/docs/model-api.txt
+++ b/docs/model-api.txt
@@ -493,9 +493,9 @@ possible values for "no data;" Django convention is to use the empty
string, not ``NULL``.
.. note::
- Due to database limitations, when using the Oracle backend the
- ``null=True`` option will be coerced for string-based fields that can
- blank, and the value ``NULL`` will be stored to denote the empty string.
+ When using the Oracle database backend, the ``null=True`` option will
+ be coerced for string-based fields that can blank, and the value
+ ``NULL`` will be stored to denote the empty string.
``blank``
~~~~~~~~~
@@ -594,9 +594,12 @@ statement for this field.
``db_tablespace``
~~~~~~~~~~~~~~~~~
-If this field is indexed, the name of the database tablespace to use for the
-index. The default is the ``db_tablespace`` of the model, if any. If the
-backend doesn't support tablespaces, this option is ignored.
+**New in Django development version**
+
+The name of the database tablespace to use for this field's index, if
+indeed this field is indexed. The default is the ``db_tablespace`` of
+the model, if any. If the backend doesn't support tablespaces, this
+option is ignored.
``default``
~~~~~~~~~~~
@@ -1011,6 +1014,8 @@ that's OK. Django quotes column and table names behind the scenes.
``db_tablespace``
-----------------
+**New in Django development version**
+
The name of the database tablespace to use for the model. If the backend
doesn't support tablespaces, this option is ignored.
diff --git a/docs/release_notes_0.96.txt b/docs/release_notes_0.96.txt
index f62780c6b2..4227de8155 100644
--- a/docs/release_notes_0.96.txt
+++ b/docs/release_notes_0.96.txt
@@ -28,7 +28,7 @@ The following changes may require you to update your code when you switch from
Due to a bug in older versions of the ``MySQLdb`` Python module (which
Django uses to connect to MySQL databases), Django's MySQL backend now
-requires version 1.2.1p2 or higher of `MySQLdb`, and will raise
+requires version 1.2.1p2 or higher of ``MySQLdb``, and will raise
exceptions if you attempt to use an older version.
If you're currently unable to upgrade your copy of ``MySQLdb`` to meet
diff --git a/docs/serialization.txt b/docs/serialization.txt
index 01afa2708c..fa9b4edd51 100644
--- a/docs/serialization.txt
+++ b/docs/serialization.txt
@@ -48,12 +48,12 @@ Subset of fields
~~~~~~~~~~~~~~~~
If you only want a subset of fields to be serialized, you can
-specify a `fields` argument to the serializer::
+specify a ``fields`` argument to the serializer::
from django.core import serializers
data = serializers.serialize('xml', SomeModel.objects.all(), fields=('name','size'))
-In this example, only the `name` and `size` attributes of each model will
+In this example, only the ``name`` and ``size`` attributes of each model will
be serialized.
.. note::
diff --git a/docs/templates_python.txt b/docs/templates_python.txt
index f3e2f2c64b..7171f32612 100644
--- a/docs/templates_python.txt
+++ b/docs/templates_python.txt
@@ -342,7 +342,7 @@ If ``TEMPLATE_CONTEXT_PROCESSORS`` contains this processor, every
* ``user`` -- An ``auth.User`` instance representing the currently
logged-in user (or an ``AnonymousUser`` instance, if the client isn't
- logged in). See the `user authentication docs`.
+ logged in). See the `user authentication docs`_.
* ``messages`` -- A list of messages (as strings) for the currently
logged-in user. Behind the scenes, this calls
diff --git a/docs/testing.txt b/docs/testing.txt
index 50c4ec3046..b326e0099d 100644
--- a/docs/testing.txt
+++ b/docs/testing.txt
@@ -253,8 +253,8 @@ can be invoked on the ``Client`` instance.
f.close()
will result in the evaluation of a POST request on ``/customers/wishes/``,
- with a POST dictionary that contains `name`, `attachment` (containing the
- file name), and `attachment_file` (containing the file data). Note that you
+ with a POST dictionary that contains ``name``, ``attachment`` (containing the
+ file name), and ``attachment_file`` (containing the file data). Note that you
need to manually close the file after it has been provided to the POST.
``login(**credentials)``
@@ -660,8 +660,8 @@ arguments:
tested. This is the same format returned by ``django.db.models.get_apps()``
Verbosity determines the amount of notification and debug information that
- will be printed to the console; `0` is no output, `1` is normal output,
- and `2` is verbose output.
+ will be printed to the console; ``0`` is no output, ``1`` is normal output,
+ and ``2`` is verbose output.
This method should return the number of tests that failed.
diff --git a/docs/tutorial01.txt b/docs/tutorial01.txt
index eb530e92ff..56a2a3fefc 100644
--- a/docs/tutorial01.txt
+++ b/docs/tutorial01.txt
@@ -360,7 +360,7 @@ Note the following:
quotes. The author of this tutorial runs PostgreSQL, so the example
output is in PostgreSQL syntax.
- * The `sql` command doesn't actually run the SQL in your database - it just
+ * The ``sql`` command doesn't actually run the SQL in your database - it just
prints it to the screen so that you can see what SQL Django thinks is required.
If you wanted to, you could copy and paste this SQL into your database prompt.
However, as we will see shortly, Django provides an easier way of committing
diff --git a/tests/modeltests/lookup/models.py b/tests/modeltests/lookup/models.py
index 03630de2d1..207b27a7d9 100644
--- a/tests/modeltests/lookup/models.py
+++ b/tests/modeltests/lookup/models.py
@@ -5,6 +5,7 @@ This demonstrates features of the database API.
"""
from django.db import models
+from django.conf import settings
class Article(models.Model):
headline = models.CharField(maxlength=100)
@@ -251,4 +252,100 @@ Traceback (most recent call last):
...
TypeError: Cannot resolve keyword 'headline__starts' into field. Choices are: id, headline, pub_date
+# Create some articles with a bit more interesting headlines for testing field lookups:
+>>> now = datetime.now()
+>>> for a in Article.objects.all():
+... a.delete()
+>>> a1 = Article(pub_date=now, headline='f')
+>>> a1.save()
+>>> a2 = Article(pub_date=now, headline='fo')
+>>> a2.save()
+>>> a3 = Article(pub_date=now, headline='foo')
+>>> a3.save()
+>>> a4 = Article(pub_date=now, headline='fooo')
+>>> a4.save()
+>>> a5 = Article(pub_date=now, headline='hey-Foo')
+>>> a5.save()
+
+# zero-or-more
+>>> Article.objects.filter(headline__regex=r'fo*')
+[