[1.6.x] Fixed #22546 -- Removed idioms in tutorial 2.

Thanks bjb at sourcerer.ca for the suggestion.

Backport of 927245ccd8 from master
[1.6.x] Fixed #22547 -- Added some links to tutorial 2.

Thanks bjb at sourcer.ca for the suggestion.

Backport of b0d032f9fc from master
[1.6.x] Fixed #22551 -- Made oracle backend method Python 3 compatible

Thanks fatal10110 at gmail.com for the report. The fix is 1.6-only
because that code has been refactored in 1.7 (6983201cfb).
[1.6.x] Fixed #22558 -- Added missing word in contributing docs

Backport of c8d257e81 from master.
[1.6.x] Fixed #22565 -- Prevented pgettext_lazy crash with bytestring input

Thanks ygbo for the report.
Backport of 142c27218 from master.
[1.6.x] Fixed #22429 -- Incorrect SQL when using ~Q and F

Backpatch of 5e1f4656b98816c96a1cc051224c1b699db480e0 from master.

Conflicts:
	django/db/models/sql/query.py
	tests/queries/models.py
	tests/queries/tests.py
[1.6.x] Fixed #22575 -- Fixed typo in docs/topics/class-based-views/generic-editing.txt.

Thanks adminq80 at gmail.com.

Backport of 87776859af from master
[1.6.x] Fixed #1349 -- Clarified docs on serving files from STATIC/MEDIA_URL.

Backport of fb7c347f7b from master
[1.6.x] Fixed #22585 -- Fixed typo in topics/auth/customizing.txt.

Thanks matt at mattwoodward.com for the report.
[1.6.x] Updated the messages context processor docs
[1.6.x] Fixed #22508 -- Avoided overwriting select_related.

Previously, known related objects overwrote related objects loaded
though select_related. This could cancel the effect of select_related
when it was used over more than one level.

Thanks boxm for the bug report and timo for bisecting the regression.

Conflicts:
	tests/select_related_regress/tests.py

Backport of f574220f from master
[1.6.x] Fix typo in release notes.
[1.6.x] Insert space.

Backport of 8eb51a8cf6 from master
[1.6.x] Fixed #22613 -- Added formfield_for_choice_field() to the list of methods that InlineModelAdmin supports.

Backport of 986bd41f8a from master
[1.6.x] Added 1.6.5 release note for refs #22508.

Backport of 13087020a9 from master
[1.6.x] Fixed #22619 -- Corrected description of os.path.

Thanks Collin Anderson for the report.

Backport of a1be7237ca from master
[1.6.x] Fixed typo in transactions.txt

Backport of f2a8e47cfd from master
Fix #7907: Tables argument of QuerySet.extra should allow subqueries.
Import django.core.urlresolvers.reverse a little bit later.

This fixes our url mangling when permalinks are used - it's a slight
hack, but won't break anything. This can be reverted if we do it
the slightly harder but "right" way using an explicit mangling
method.
Test fixes for non-unique emails.