[Python-modules-commits] [python-django] 01/03: Imported Upstream version 1.7.5

Raphaël Hertzog hertzog at moszumanska.debian.org
Fri Mar 6 20:55:11 UTC 2015


This is an automated email from the git hooks/post-receive script.

hertzog pushed a commit to branch debian/sid
in repository python-django.

commit b3fae5901daef52cccdd77e066ea473ff56a581c
Author: Raphaël Hertzog <hertzog at debian.org>
Date:   Fri Mar 6 21:12:57 2015 +0100

    Imported Upstream version 1.7.5
---
 Django.egg-info/PKG-INFO                       |  2 +-
 Django.egg-info/SOURCES.txt                    |  3 ++
 PKG-INFO                                       |  2 +-
 django/__init__.py                             |  2 +-
 django/conf/locale/az/__init__.py              |  0
 django/conf/locale/az/formats.py               | 35 ++++++++++++++
 django/contrib/auth/management/__init__.py     |  5 --
 django/contrib/auth/tests/test_management.py   | 20 +-------
 django/contrib/contenttypes/management.py      |  5 --
 django/contrib/contenttypes/tests/tests.py     | 23 +--------
 django/contrib/sites/management.py             |  2 +-
 django/contrib/sites/tests.py                  | 14 +++++-
 django/db/backends/postgresql_psycopg2/base.py | 28 +++++++++--
 django/db/backends/schema.py                   |  7 ++-
 django/db/backends/sqlite3/schema.py           | 11 +++--
 django/db/migrations/loader.py                 | 12 -----
 docs/howto/custom-template-tags.txt            | 24 ++++++---
 docs/howto/deployment/wsgi/uwsgi.txt           |  2 +-
 docs/howto/outputting-pdf.txt                  |  2 +-
 docs/howto/upgrade-version.txt                 |  4 +-
 docs/intro/overview.txt                        |  2 +-
 docs/intro/tutorial01.txt                      | 51 ++++++++++----------
 docs/intro/tutorial02.txt                      |  6 +--
 docs/intro/whatsnext.txt                       |  6 +--
 docs/ref/class-based-views/flattened-index.txt |  6 +--
 docs/ref/class-based-views/mixins-editing.txt  | 18 ++-----
 docs/ref/contrib/formtools/form-wizard.txt     |  2 +-
 docs/ref/contrib/gis/geos.txt                  |  3 +-
 docs/ref/contrib/gis/install/geolibs.txt       |  2 +-
 docs/ref/contrib/gis/tutorial.txt              | 34 ++++++-------
 docs/ref/databases.txt                         | 29 +++++------
 docs/ref/django-admin.txt                      |  4 +-
 docs/ref/forms/validation.txt                  |  4 +-
 docs/ref/models/instances.txt                  |  2 +-
 docs/ref/models/querysets.txt                  |  4 +-
 docs/ref/settings.txt                          |  2 +-
 docs/releases/1.0-porting-guide.txt            |  6 +--
 docs/releases/1.4.13.txt                       |  2 +-
 docs/releases/1.4.18.txt                       |  2 +-
 docs/releases/1.4.6.txt                        |  2 +-
 docs/releases/1.5.2.txt                        |  2 +-
 docs/releases/1.5.8.txt                        |  2 +-
 docs/releases/1.6.10.txt                       |  2 +-
 docs/releases/1.6.5.txt                        |  2 +-
 docs/releases/1.6.txt                          |  9 ++--
 docs/releases/1.7.3.txt                        |  2 +-
 docs/releases/1.7.5.txt                        | 27 +++++++++++
 docs/releases/index.txt                        |  1 +
 docs/spelling_wordlist                         | 45 ++++++++++++++++-
 docs/topics/cache.txt                          |  7 +--
 docs/topics/i18n/timezones.txt                 |  2 +-
 docs/topics/install.txt                        | 67 +++++++++++---------------
 docs/topics/migrations.txt                     | 19 +++++++-
 docs/topics/testing/advanced.txt               |  2 +
 docs/topics/testing/tools.txt                  | 42 +++++++---------
 setup.cfg                                      |  3 +-
 tests/backends/tests.py                        | 28 +++++++++++
 tests/schema/fields.py                         |  4 ++
 tests/schema/tests.py                          | 46 +++++++++++++++++-
 59 files changed, 431 insertions(+), 271 deletions(-)

diff --git a/Django.egg-info/PKG-INFO b/Django.egg-info/PKG-INFO
index 9665a62..8457a3f 100644
--- a/Django.egg-info/PKG-INFO
+++ b/Django.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: Django
-Version: 1.7.4
+Version: 1.7.5
 Summary: A high-level Python Web framework that encourages rapid development and clean, pragmatic design.
 Home-page: http://www.djangoproject.com/
 Author: Django Software Foundation
diff --git a/Django.egg-info/SOURCES.txt b/Django.egg-info/SOURCES.txt
index 1b23ece..da86442 100644
--- a/Django.egg-info/SOURCES.txt
+++ b/Django.egg-info/SOURCES.txt
@@ -34,6 +34,8 @@ django/conf/locale/ar/LC_MESSAGES/django.mo
 django/conf/locale/ar/LC_MESSAGES/django.po
 django/conf/locale/ast/LC_MESSAGES/django.mo
 django/conf/locale/ast/LC_MESSAGES/django.po
+django/conf/locale/az/__init__.py
+django/conf/locale/az/formats.py
 django/conf/locale/az/LC_MESSAGES/django.mo
 django/conf/locale/az/LC_MESSAGES/django.po
 django/conf/locale/be/LC_MESSAGES/django.mo
@@ -4020,6 +4022,7 @@ docs/releases/1.7.1.txt
 docs/releases/1.7.2.txt
 docs/releases/1.7.3.txt
 docs/releases/1.7.4.txt
+docs/releases/1.7.5.txt
 docs/releases/1.7.txt
 docs/releases/index.txt
 docs/releases/security.txt
diff --git a/PKG-INFO b/PKG-INFO
index 9665a62..8457a3f 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: Django
-Version: 1.7.4
+Version: 1.7.5
 Summary: A high-level Python Web framework that encourages rapid development and clean, pragmatic design.
 Home-page: http://www.djangoproject.com/
 Author: Django Software Foundation
diff --git a/django/__init__.py b/django/__init__.py
index 6b6cd79..0e4c6e8 100644
--- a/django/__init__.py
+++ b/django/__init__.py
@@ -1,4 +1,4 @@
-VERSION = (1, 7, 4, 'final', 0)
+VERSION = (1, 7, 5, 'final', 0)
 
 
 def get_version(*args, **kwargs):
diff --git a/django/conf/locale/az/__init__.py b/django/conf/locale/az/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/django/conf/locale/az/formats.py b/django/conf/locale/az/formats.py
new file mode 100644
index 0000000..07b1181
--- /dev/null
+++ b/django/conf/locale/az/formats.py
@@ -0,0 +1,35 @@
+# -*- encoding: utf-8 -*-
+# This file is distributed under the same license as the Django package.
+#
+from __future__ import unicode_literals
+
+# The *_FORMAT strings use the Django date format syntax,
+# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
+DATE_FORMAT = 'j E Y г.'
+TIME_FORMAT = 'G:i'
+DATETIME_FORMAT = 'j E Y г. G:i'
+YEAR_MONTH_FORMAT = 'F Y г.'
+MONTH_DAY_FORMAT = 'j F'
+SHORT_DATE_FORMAT = 'd.m.Y'
+SHORT_DATETIME_FORMAT = 'd.m.Y H:i'
+FIRST_DAY_OF_WEEK = 1  # Monday
+
+# The *_INPUT_FORMATS strings use the Python strftime format syntax,
+# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
+DATE_INPUT_FORMATS = [
+    '%d.%m.%Y',  # '25.10.2006'
+    '%d.%m.%y',  # '25.10.06'
+]
+DATETIME_INPUT_FORMATS = [
+    '%d.%m.%Y %H:%M:%S',     # '25.10.2006 14:30:59'
+    '%d.%m.%Y %H:%M:%S.%f',  # '25.10.2006 14:30:59.000200'
+    '%d.%m.%Y %H:%M',        # '25.10.2006 14:30'
+    '%d.%m.%Y',              # '25.10.2006'
+    '%d.%m.%y %H:%M:%S',     # '25.10.06 14:30:59'
+    '%d.%m.%y %H:%M:%S.%f',  # '25.10.06 14:30:59.000200'
+    '%d.%m.%y %H:%M',        # '25.10.06 14:30'
+    '%d.%m.%y',              # '25.10.06'
+]
+DECIMAL_SEPARATOR = ','
+THOUSAND_SEPARATOR = '\xa0'  # non-breaking space
+NUMBER_GROUPING = 3
diff --git a/django/contrib/auth/management/__init__.py b/django/contrib/auth/management/__init__.py
index 683a8d5..18cdcce 100644
--- a/django/contrib/auth/management/__init__.py
+++ b/django/contrib/auth/management/__init__.py
@@ -11,7 +11,6 @@ from django.contrib.auth import models as auth_app, get_permission_codename
 from django.core import exceptions
 from django.core.management.base import CommandError
 from django.db import DEFAULT_DB_ALIAS, router
-from django.db.migrations.loader import is_latest_migration_applied
 from django.db.models import signals
 from django.utils.encoding import DEFAULT_LOCALE_ENCODING
 from django.utils import six
@@ -60,10 +59,6 @@ def _check_permission_clashing(custom, builtin, ctype):
 
 
 def create_permissions(app_config, verbosity=2, interactive=True, using=DEFAULT_DB_ALIAS, **kwargs):
-    # TODO: Remove when migration plan / state is passed (#24100).
-    if not is_latest_migration_applied('auth'):
-        return
-
     if not app_config.models_module:
         return
 
diff --git a/django/contrib/auth/tests/test_management.py b/django/contrib/auth/tests/test_management.py
index a807aca..7fd41b9 100644
--- a/django/contrib/auth/tests/test_management.py
+++ b/django/contrib/auth/tests/test_management.py
@@ -17,7 +17,7 @@ from django.core import checks
 from django.core import exceptions
 from django.core.management import call_command
 from django.core.management.base import CommandError
-from django.test import TestCase, override_settings, override_system_checks, skipUnlessDBFeature
+from django.test import TestCase, override_settings, override_system_checks
 from django.utils import six
 from django.utils.encoding import force_str
 
@@ -506,21 +506,3 @@ class PermissionTestCase(TestCase):
         six.assertRaisesRegex(self, exceptions.ValidationError,
             "The verbose_name of permission is longer than 39 characters",
             create_permissions, auth_app_config, verbosity=0)
-
-
-class MigrateTests(TestCase):
-
-    @skipUnlessDBFeature('can_rollback_ddl')
-    def test_unmigrating_first_migration_post_migrate_signal(self):
-        """
-        #24075 - When unmigrating an app before its first migration,
-        post_migrate signal handler must be aware of the missing tables.
-        """
-        try:
-            with override_settings(
-                INSTALLED_APPS=["django.contrib.auth", "django.contrib.contenttypes"],
-                MIGRATION_MODULES={'auth': 'django.contrib.auth.migrations'},
-            ):
-                call_command("migrate", "auth", "zero", verbosity=0)
-        finally:
-            call_command("migrate", verbosity=0)
diff --git a/django/contrib/contenttypes/management.py b/django/contrib/contenttypes/management.py
index 91984a8..f705330 100644
--- a/django/contrib/contenttypes/management.py
+++ b/django/contrib/contenttypes/management.py
@@ -1,6 +1,5 @@
 from django.apps import apps
 from django.db import DEFAULT_DB_ALIAS, router
-from django.db.migrations.loader import is_latest_migration_applied
 from django.db.models import signals
 from django.utils.encoding import smart_text
 from django.utils import six
@@ -12,10 +11,6 @@ def update_contenttypes(app_config, verbosity=2, interactive=True, using=DEFAULT
     Creates content types for models in the given app, removing any model
     entries that no longer have a matching model class.
     """
-    # TODO: Remove when migration plan / state is passed (#24100).
-    if not is_latest_migration_applied('contenttypes'):
-        return
-
     if not app_config.models_module:
         return
 
diff --git a/django/contrib/contenttypes/tests/tests.py b/django/contrib/contenttypes/tests/tests.py
index dc3e8ba..924ffdc 100644
--- a/django/contrib/contenttypes/tests/tests.py
+++ b/django/contrib/contenttypes/tests/tests.py
@@ -3,10 +3,8 @@ from __future__ import unicode_literals
 from django.contrib.contenttypes.models import ContentType
 from django.contrib.contenttypes.views import shortcut
 from django.contrib.sites.shortcuts import get_current_site
-from django.core.management import call_command
 from django.http import HttpRequest, Http404
-from django.test import TestCase, override_settings, skipUnlessDBFeature
-from django.test.utils import override_system_checks
+from django.test import TestCase, override_settings
 from django.utils import six
 
 from .models import ConcreteModel, ProxyModel, FooWithoutUrl, FooWithUrl, FooWithBrokenAbsoluteUrl
@@ -243,22 +241,3 @@ class ContentTypesTests(TestCase):
         # Instead, just return the ContentType object and let the app detect stale states.
         ct_fetched = ContentType.objects.get_for_id(ct.pk)
         self.assertIsNone(ct_fetched.model_class())
-
-
-class MigrateTests(TestCase):
-
-    @skipUnlessDBFeature('can_rollback_ddl')
-    @override_system_checks([])
-    def test_unmigrating_first_migration_post_migrate_signal(self):
-        """
-        #24075 - When unmigrating an app before its first migration,
-        post_migrate signal handler must be aware of the missing tables.
-        """
-        try:
-            with override_settings(
-                INSTALLED_APPS=["django.contrib.contenttypes"],
-                MIGRATION_MODULES={'contenttypes': 'django.contrib.contenttypes.migrations'},
-            ):
-                call_command("migrate", "contenttypes", "zero", verbosity=0)
-        finally:
-            call_command("migrate", verbosity=0)
diff --git a/django/contrib/sites/management.py b/django/contrib/sites/management.py
index 99ec793..b3a8347 100644
--- a/django/contrib/sites/management.py
+++ b/django/contrib/sites/management.py
@@ -17,7 +17,7 @@ def create_default_site(app_config, verbosity=2, interactive=True, using=DEFAULT
     if not router.allow_migrate(using, Site):
         return
 
-    if not Site.objects.exists():
+    if not Site.objects.using(using).exists():
         # The default settings set SITE_ID = 1, and some tests in Django's test
         # suite rely on this value. However, if database sequences are reused
         # (e.g. in the test suite after flush/syncdb), it isn't guaranteed that
diff --git a/django/contrib/sites/tests.py b/django/contrib/sites/tests.py
index e59eb64..e9f68c8 100644
--- a/django/contrib/sites/tests.py
+++ b/django/contrib/sites/tests.py
@@ -1,9 +1,11 @@
 from __future__ import unicode_literals
 
+import unittest
+
 from django.apps import apps
 from django.conf import settings
 from django.core.exceptions import ObjectDoesNotExist, ValidationError
-from django.db import router
+from django.db import connections, router
 from django.http import HttpRequest
 from django.test import TestCase, modify_settings, override_settings
 
@@ -104,7 +106,8 @@ class CreateDefaultSiteTests(TestCase):
         create_default_site(self.app_config, verbosity=0)
         self.assertEqual(Site.objects.count(), 1)
 
-    def test_multi_db(self):
+    @unittest.skipIf('other' not in connections, "Requires 'other' database connection.")
+    def test_multi_db_with_router(self):
         """
         #16353, #16828 - The default site creation should respect db routing.
         """
@@ -118,6 +121,13 @@ class CreateDefaultSiteTests(TestCase):
         finally:
             router.routers = old_routers
 
+    @unittest.skipIf('other' not in connections, "Requires 'other' database connection.")
+    def test_multi_db(self):
+        create_default_site(self.app_config, using='default', verbosity=0)
+        create_default_site(self.app_config, using='other', verbosity=0)
+        self.assertTrue(Site.objects.using('default').exists())
+        self.assertTrue(Site.objects.using('other').exists())
+
     def test_save_another(self):
         """
         #17415 - Another site can be created right after the default one.
diff --git a/django/db/backends/postgresql_psycopg2/base.py b/django/db/backends/postgresql_psycopg2/base.py
index 17bc862..0454f9d 100644
--- a/django/db/backends/postgresql_psycopg2/base.py
+++ b/django/db/backends/postgresql_psycopg2/base.py
@@ -93,10 +93,6 @@ class DatabaseWrapper(BaseDatabaseWrapper):
     def __init__(self, *args, **kwargs):
         super(DatabaseWrapper, self).__init__(*args, **kwargs)
 
-        opts = self.settings_dict["OPTIONS"]
-        RC = psycopg2.extensions.ISOLATION_LEVEL_READ_COMMITTED
-        self.isolation_level = opts.get('isolation_level', RC)
-
         self.features = DatabaseFeatures(self)
         self.ops = DatabaseOperations(self)
         self.client = DatabaseClient(self)
@@ -131,7 +127,29 @@ class DatabaseWrapper(BaseDatabaseWrapper):
         return conn_params
 
     def get_new_connection(self, conn_params):
-        return Database.connect(**conn_params)
+        connection = Database.connect(**conn_params)
+
+        # self.isolation_level must be set:
+        # - after connecting to the database in order to obtain the database's
+        #   default when no value is explicitly specified in options.
+        # - before calling _set_autocommit() because if autocommit is on, that
+        #   will set connection.isolation_level to ISOLATION_LEVEL_AUTOCOMMIT;
+        #   and if autocommit is off, on psycopg2 < 2.4.2, _set_autocommit()
+        #   needs self.isolation_level.
+        options = self.settings_dict['OPTIONS']
+        try:
+            self.isolation_level = options['isolation_level']
+        except KeyError:
+            self.isolation_level = connection.isolation_level
+        else:
+            # Set the isolation level to the value from OPTIONS. This isn't
+            # needed on psycopg2 < 2.4.2 because it happens as a side-effect
+            # of _set_autocommit(False).
+            if (self.isolation_level != connection.isolation_level and
+                    self.psycopg2_version >= (2, 4, 2)):
+                connection.set_session(isolation_level=self.isolation_level)
+
+        return connection
 
     def init_connection_state(self):
         settings_dict = self.settings_dict
diff --git a/django/db/backends/schema.py b/django/db/backends/schema.py
index 12e2ab7..54e6e06 100644
--- a/django/db/backends/schema.py
+++ b/django/db/backends/schema.py
@@ -3,6 +3,7 @@ import operator
 
 from django.db.backends.creation import BaseDatabaseCreation
 from django.db.backends.utils import truncate_name
+from django.db.models.fields.related import ManyToManyField
 from django.db.transaction import atomic
 from django.utils.encoding import force_bytes
 from django.utils.log import getLogger
@@ -358,7 +359,8 @@ class BaseDatabaseSchemaEditor(object):
         table instead (for M2M fields)
         """
         # Special-case implicit M2M tables
-        if field.get_internal_type() == 'ManyToManyField' and field.rel.through._meta.auto_created:
+        if ((isinstance(field, ManyToManyField) or field.get_internal_type() == 'ManyToManyField') and
+                field.rel.through._meta.auto_created):
             return self.create_model(field.rel.through)
         # Get the column's definition
         definition, params = self.column_sql(model, field, include_default=True)
@@ -402,7 +404,8 @@ class BaseDatabaseSchemaEditor(object):
         but for M2Ms may involve deleting a table.
         """
         # Special-case implicit M2M tables
-        if field.get_internal_type() == 'ManyToManyField' and field.rel.through._meta.auto_created:
+        if ((isinstance(field, ManyToManyField) or field.get_internal_type() == 'ManyToManyField') and
+                field.rel.through._meta.auto_created):
             return self.delete_model(field.rel.through)
         # It might not actually have a column behind it
         if field.db_parameters(connection=self.connection)['type'] is None:
diff --git a/django/db/backends/sqlite3/schema.py b/django/db/backends/sqlite3/schema.py
index c5f56a0..0f41cb7 100644
--- a/django/db/backends/sqlite3/schema.py
+++ b/django/db/backends/sqlite3/schema.py
@@ -4,6 +4,7 @@ from decimal import Decimal
 from django.utils import six
 from django.apps.registry import Apps
 from django.db.backends.schema import BaseDatabaseSchemaEditor
+from django.db.models.fields.related import ManyToManyField
 
 
 class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
@@ -69,7 +70,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
         for field in create_fields:
             body[field.name] = field
             # Choose a default and insert it into the copy map
-            if not field.get_internal_type() == 'ManyToManyField':
+            if not (isinstance(field, ManyToManyField) or field.get_internal_type() == 'ManyToManyField'):
                 mapping[field.column] = self.quote_value(
                     self.effective_default(field)
                 )
@@ -92,7 +93,8 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
             del body[field.name]
             del mapping[field.column]
             # Remove any implicit M2M tables
-            if field.get_internal_type() == 'ManyToManyField' and field.rel.through._meta.auto_created:
+            if ((isinstance(field, ManyToManyField) or field.get_internal_type() == 'ManyToManyField') and
+                    field.rel.through._meta.auto_created):
                 return self.delete_model(field.rel.through)
         # Work inside a new app registry
         apps = Apps()
@@ -171,7 +173,8 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
         table instead (for M2M fields)
         """
         # Special-case implicit M2M tables
-        if field.get_internal_type() == 'ManyToManyField' and field.rel.through._meta.auto_created:
+        if ((isinstance(field, ManyToManyField) or field.get_internal_type() == 'ManyToManyField') and
+                field.rel.through._meta.auto_created):
             return self.create_model(field.rel.through)
         self._remake_table(model, create_fields=[field])
 
@@ -181,7 +184,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
         but for M2Ms may involve deleting a table.
         """
         # M2M fields are a special case
-        if field.get_internal_type() == 'ManyToManyField':
+        if isinstance(field, ManyToManyField) or field.get_internal_type() == 'ManyToManyField':
             # For implicit M2M tables, delete the auto-created table
             if field.rel.through._meta.auto_created:
                 self.delete_model(field.rel.through)
diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py
index b700616..923202a 100644
--- a/django/db/migrations/loader.py
+++ b/django/db/migrations/loader.py
@@ -5,7 +5,6 @@ import os
 import sys
 
 from django.apps import apps
-from django.db import connection
 from django.db.migrations.recorder import MigrationRecorder
 from django.db.migrations.graph import MigrationGraph
 from django.utils import six
@@ -285,14 +284,3 @@ class AmbiguityError(Exception):
     Raised when more than one migration matches a name prefix
     """
     pass
-
-
-def is_latest_migration_applied(app_label):
-    # TODO: Remove when migration plan / state is passed (#24100).
-    loader = MigrationLoader(connection)
-    loader.load_disk()
-    leaf_nodes = loader.graph.leaf_nodes(app=app_label)
-    return (
-        leaf_nodes and leaf_nodes[0] in loader.applied_migrations or
-        app_label in loader.unmigrated_apps
-    )
diff --git a/docs/howto/custom-template-tags.txt b/docs/howto/custom-template-tags.txt
index f26fa34..8132634 100644
--- a/docs/howto/custom-template-tags.txt
+++ b/docs/howto/custom-template-tags.txt
@@ -442,9 +442,13 @@ object:
             # split_contents() knows not to split quoted strings.
             tag_name, format_string = token.split_contents()
         except ValueError:
-            raise template.TemplateSyntaxError("%r tag requires a single argument" % token.contents.split()[0])
+            raise template.TemplateSyntaxError(
+                "%r tag requires a single argument" % token.contents.split()[0]
+            )
         if not (format_string[0] == format_string[-1] and format_string[0] in ('"', "'")):
-            raise template.TemplateSyntaxError("%r tag's argument should be in quotes" % tag_name)
+            raise template.TemplateSyntaxError(
+                "%r tag's argument should be in quotes" % tag_name
+            )
         return CurrentTimeNode(format_string[1:-1])
 
 Notes:
@@ -717,9 +721,13 @@ Now your tag should begin to look like this:
             # split_contents() knows not to split quoted strings.
             tag_name, date_to_be_formatted, format_string = token.split_contents()
         except ValueError:
-            raise template.TemplateSyntaxError("%r tag requires exactly two arguments" % token.contents.split()[0])
+            raise template.TemplateSyntaxError(
+                "%r tag requires exactly two arguments" % token.contents.split()[0]
+            )
         if not (format_string[0] == format_string[-1] and format_string[0] in ('"', "'")):
-            raise template.TemplateSyntaxError("%r tag's argument should be in quotes" % tag_name)
+            raise template.TemplateSyntaxError(
+                "%r tag's argument should be in quotes" % tag_name
+            )
         return FormatTimeNode(date_to_be_formatted, format_string[1:-1])
 
 You also have to change the renderer to retrieve the actual contents of the
@@ -1077,13 +1085,17 @@ class, like so:
             # Splitting by None == splitting by spaces.
             tag_name, arg = token.contents.split(None, 1)
         except ValueError:
-            raise template.TemplateSyntaxError("%r tag requires arguments" % token.contents.split()[0])
+            raise template.TemplateSyntaxError(
+                "%r tag requires arguments" % token.contents.split()[0]
+            )
         m = re.search(r'(.*?) as (\w+)', arg)
         if not m:
             raise template.TemplateSyntaxError("%r tag had invalid arguments" % tag_name)
         format_string, var_name = m.groups()
         if not (format_string[0] == format_string[-1] and format_string[0] in ('"', "'")):
-            raise template.TemplateSyntaxError("%r tag's argument should be in quotes" % tag_name)
+            raise template.TemplateSyntaxError(
+                "%r tag's argument should be in quotes" % tag_name
+            )
         return CurrentTimeNode3(format_string[1:-1], var_name)
 
 The difference here is that ``do_current_time()`` grabs the format string and
diff --git a/docs/howto/deployment/wsgi/uwsgi.txt b/docs/howto/deployment/wsgi/uwsgi.txt
index 8263e10..154b6ed 100644
--- a/docs/howto/deployment/wsgi/uwsgi.txt
+++ b/docs/howto/deployment/wsgi/uwsgi.txt
@@ -24,7 +24,7 @@ The uWSGI wiki describes several `installation procedures`_. Using pip, the
 Python package manager, you can install any uWSGI version with a single
 command. For example:
 
-.. code-block:: bash
+.. code-block:: console
 
     # Install current stable version.
     $ sudo pip install uwsgi
diff --git a/docs/howto/outputting-pdf.txt b/docs/howto/outputting-pdf.txt
index d15f94f..6e83e79 100644
--- a/docs/howto/outputting-pdf.txt
+++ b/docs/howto/outputting-pdf.txt
@@ -25,7 +25,7 @@ http://www.reportlab.com/software/opensource/rl-toolkit/download/.
 The `user guide`_ (not coincidentally, a PDF file) explains how to install it.
 Alternatively, you can also install it with ``pip``:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ sudo pip install reportlab
 
diff --git a/docs/howto/upgrade-version.txt b/docs/howto/upgrade-version.txt
index 82666d6..3c9c1b8 100644
--- a/docs/howto/upgrade-version.txt
+++ b/docs/howto/upgrade-version.txt
@@ -52,7 +52,7 @@ might want to set up a new environment with all the dependencies first.
 Exactly which steps you will need to take depends on your installation process.
 The most convenient way is to use pip_ with the ``--upgrade`` or ``-U`` flag:
 
-.. code-block:: bash
+.. code-block:: console
 
    $ pip install -U Django
 
@@ -74,7 +74,7 @@ warnings are silenced by default. It is useful to turn the warnings on so they
 are shown in the test output (you can also use the flag if you test your app
 manually using ``manage.py runserver``):
 
-.. code-block:: bash
+.. code-block:: console
 
     $ python -Wall manage.py test
 
diff --git a/docs/intro/overview.txt b/docs/intro/overview.txt
index c626fe7..6847eb3 100644
--- a/docs/intro/overview.txt
+++ b/docs/intro/overview.txt
@@ -51,7 +51,7 @@ Install it
 Next, run the Django command-line utility to create the database tables
 automatically:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ python manage.py migrate
 
diff --git a/docs/intro/tutorial01.txt b/docs/intro/tutorial01.txt
index 4a57711..0a80c84 100644
--- a/docs/intro/tutorial01.txt
+++ b/docs/intro/tutorial01.txt
@@ -15,7 +15,7 @@ It'll consist of two parts:
 We'll assume you have :doc:`Django installed </intro/install>` already. You can
 tell Django is installed and which version by running the following command:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ python -c "import django; print(django.get_version())"
 
@@ -51,7 +51,7 @@ application-specific settings.
 From the command line, ``cd`` into a directory where you'd like to store your
 code, then run the following command:
 
-.. code-block:: bash
+.. code-block:: console
 
    $ django-admin.py startproject mysite
 
@@ -134,7 +134,9 @@ module-level variables representing Django settings.
 By default, the configuration uses SQLite. If you're new to databases, or
 you're just interested in trying Django, this is the easiest choice. SQLite is
 included in Python, so you won't need to install anything else to support your
-database.
+database. When starting your first real project, however, you may want to use a
+more robust database like PostgreSQL, to avoid database-switching headaches
+down the road.
 
 If you wish to use another database, install the appropriate :ref:`database
 bindings <database-installation>`, and change the following keys in the
@@ -197,7 +199,7 @@ Some of these applications makes use of at least one database table, though,
 so we need to create the tables in the database before we can use them. To do
 that, run the following command:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ python manage.py migrate
 
@@ -224,7 +226,7 @@ The development server
 Let's verify your Django project works. Change into the outer :file:`mysite` directory, if
 you haven't already, and run the following commands:
 
-.. code-block:: bash
+.. code-block:: console
 
    $ python manage.py runserver
 
@@ -262,7 +264,7 @@ It worked!
     it as a command-line argument. For instance, this command starts the server
     on port 8080:
 
-    .. code-block:: bash
+    .. code-block:: console
 
         $ python manage.py runserver 8080
 
@@ -270,7 +272,7 @@ It worked!
     listen on all public IPs (useful if you want to show off your work on other
     computers), use:
 
-    .. code-block:: bash
+    .. code-block:: console
 
         $ python manage.py runserver 0.0.0.0:8000
 
@@ -312,7 +314,7 @@ imported as its own top-level module, rather than a submodule of ``mysite``.
 To create your app, make sure you're in the same directory as :file:`manage.py`
 and type this command:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ python manage.py startapp polls
 
@@ -441,7 +443,7 @@ look like this:
 
 Now Django knows to include the ``polls`` app. Let's run another command:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ python manage.py makemigrations polls
 
@@ -471,39 +473,36 @@ schema automatically - that's called :djadmin:`migrate`, and we'll come to it in
 moment - but first, let's see what SQL that migration would run. The
 :djadmin:`sqlmigrate` command takes migration names and returns their SQL:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ python manage.py sqlmigrate polls 0001
 
-
 You should see something similar to the following (we've reformatted it for
 readability):
 
 .. code-block:: sql
 
     BEGIN;
-    CREATE TABLE polls_question (
+    CREATE TABLE "polls_choice" (
         "id" serial NOT NULL PRIMARY KEY,
-        "question_text" varchar(200) NOT NULL,
-        "pub_date" timestamp with time zone NOT NULL
-    );
-
-    CREATE TABLE polls_choice (
-        "id" serial NOT NULL PRIMARY KEY,
-        "question_id" integer NOT NULL,
         "choice_text" varchar(200) NOT NULL,
         "votes" integer NOT NULL
     );
-
-    CREATE INDEX polls_choice_7aa0f6ee ON "polls_choice" ("question_id");
-
+    CREATE TABLE "polls_question" (
+        "id" serial NOT NULL PRIMARY KEY,
+        "question_text" varchar(200) NOT NULL,
+        "pub_date" timestamp with time zone NOT NULL
+    );
+    ALTER TABLE "polls_choice" ADD COLUMN "question_id" integer NOT NULL;
+    ALTER TABLE "polls_choice" ALTER COLUMN "question_id" DROP DEFAULT;
+    CREATE INDEX "polls_choice_7aa0f6ee" ON "polls_choice" ("question_id");
     ALTER TABLE "polls_choice"
-      ADD CONSTRAINT polls_choice_question_id_246c99a640fbbd72_fk_polls_question_id
+      ADD CONSTRAINT "polls_choice_question_id_246c99a640fbbd72_fk_polls_question_id"
         FOREIGN KEY ("question_id")
         REFERENCES "polls_question" ("id")
         DEFERRABLE INITIALLY DEFERRED;
-    COMMIT;
 
+    COMMIT;
 
 Note the following:
 
@@ -541,7 +540,7 @@ your project without making migrations or touching the database.
 
 Now, run :djadmin:`migrate` again to create those model tables in your database:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ python manage.py migrate
     Operations to perform:
@@ -581,7 +580,7 @@ Playing with the API
 Now, let's hop into the interactive Python shell and play around with the free
 API Django gives you. To invoke the Python shell, use this command:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ python manage.py shell
 
diff --git a/docs/intro/tutorial02.txt b/docs/intro/tutorial02.txt
index ae32a44..d66b8d6 100644
--- a/docs/intro/tutorial02.txt
+++ b/docs/intro/tutorial02.txt
@@ -27,7 +27,7 @@ Creating an admin user
 First we'll need to create a user who can login to the admin site. Run the
 following command:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ python manage.py createsuperuser
 
@@ -60,7 +60,7 @@ server and explore it.
 
 Recall from Tutorial 1 that you start the development server like so:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ python manage.py runserver
 
@@ -508,7 +508,7 @@ template directory in the source code of Django itself
     If you have difficulty finding where the Django source files are located
     on your system, run the following command:
 
-    .. code-block:: bash
+    .. code-block:: console
 
         $ python -c "
         import sys
diff --git a/docs/intro/whatsnext.txt b/docs/intro/whatsnext.txt
index 4a5c3e2..c9ef98b 100644
--- a/docs/intro/whatsnext.txt
+++ b/docs/intro/whatsnext.txt
@@ -150,7 +150,7 @@ Unix ``grep`` utility to search for a phrase in all of the documentation. For
 example, this will show you each mention of the phrase "max_length" in any
 Django document:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ grep -r max_length /path/to/django/docs/
 
@@ -163,14 +163,14 @@ You can get a local copy of the HTML documentation following a few easy steps:
   plain text to HTML. You'll need to install Sphinx by either downloading
   and installing the package from the Sphinx Web site, or with ``pip``:
 
-  .. code-block:: bash
+  .. code-block:: console
 
         $ sudo pip install Sphinx
 
 * Then, just use the included ``Makefile`` to turn the documentation into
   HTML:
 
-  .. code-block:: bash
+  .. code-block:: console
 
         $ cd path/to/django/docs
         $ make html
diff --git a/docs/ref/class-based-views/flattened-index.txt b/docs/ref/class-based-views/flattened-index.txt
index be14a34..c6c06ad 100644
--- a/docs/ref/class-based-views/flattened-index.txt
+++ b/docs/ref/class-based-views/flattened-index.txt
@@ -163,7 +163,7 @@ FormView
 * :meth:`~django.views.generic.edit.FormMixin.form_invalid`
 * :meth:`~django.views.generic.edit.FormMixin.form_valid`
 * :meth:`~django.views.generic.edit.ProcessFormView.get`
-* :meth:`~django.views.generic.edit.FormMixin.get_context_data`
+* :meth:`~django.views.generic.base.ContextMixin.get_context_data`
 * :meth:`~django.views.generic.edit.FormMixin.get_form`
 * :meth:`~django.views.generic.edit.FormMixin.get_form_kwargs`
 * :meth:`~django.views.generic.base.View.http_method_not_allowed`
@@ -201,7 +201,7 @@ CreateView
 * :meth:`~django.views.generic.edit.FormMixin.form_invalid`
 * :meth:`~django.views.generic.edit.FormMixin.form_valid`
 * :meth:`~django.views.generic.edit.ProcessFormView.get`
-* :meth:`~django.views.generic.edit.FormMixin.get_context_data`
+* :meth:`~django.views.generic.base.ContextMixin.get_context_data`
 * :meth:`~django.views.generic.edit.FormMixin.get_form`
 * :meth:`~django.views.generic.edit.FormMixin.get_form_kwargs`
 * :meth:`~django.views.generic.detail.SingleObjectMixin.get_object`
@@ -242,7 +242,7 @@ UpdateView
 * :meth:`~django.views.generic.edit.FormMixin.form_invalid`
 * :meth:`~django.views.generic.edit.FormMixin.form_valid`
 * :meth:`~django.views.generic.edit.ProcessFormView.get`
-* :meth:`~django.views.generic.edit.FormMixin.get_context_data`
+* :meth:`~django.views.generic.base.ContextMixin.get_context_data`
 * :meth:`~django.views.generic.edit.FormMixin.get_form`
 * :meth:`~django.views.generic.edit.FormMixin.get_form_kwargs`
 * :meth:`~django.views.generic.detail.SingleObjectMixin.get_object`
diff --git a/docs/ref/class-based-views/mixins-editing.txt b/docs/ref/class-based-views/mixins-editing.txt
index dbe1c91..494effb 100644
--- a/docs/ref/class-based-views/mixins-editing.txt
+++ b/docs/ref/class-based-views/mixins-editing.txt
@@ -21,6 +21,10 @@ FormMixin
 
     A mixin class that provides facilities for creating and displaying forms.
 
+    **Mixins**
+
+    * :class:`django.views.generic.base.ContextMixin`
+
     **Methods and Attributes**
 
     .. attribute:: initial
@@ -86,20 +90,6 @@ FormMixin
 
         Renders a response, providing the invalid form as context.
 
-    .. method:: get_context_data(**kwargs)
-
-        Populates a context containing the contents of ``kwargs``.
-
-    **Context**
-
-    * ``form``: The form instance that was generated for the view.
-
-    .. note::
-
-        Views mixing ``FormMixin`` must provide an implementation of
-        :meth:`form_valid` and :meth:`form_invalid`.
-
-
 ModelFormMixin
 --------------
 
diff --git a/docs/ref/contrib/formtools/form-wizard.txt b/docs/ref/contrib/formtools/form-wizard.txt
index d41b025..7e41c5e 100644
--- a/docs/ref/contrib/formtools/form-wizard.txt
+++ b/docs/ref/contrib/formtools/form-wizard.txt
@@ -319,7 +319,7 @@ The ``urls.py`` file would contain something like::
 
 .. versionchanged:: 1.6
 
-The ``condition_dict`` can be passed as attribute for the ``as_view()`
+The ``condition_dict`` can be passed as attribute for the ``as_view()``
 method or as a class attribute named ``condition_dict``::
 
     class OrderWizard(WizardView):
diff --git a/docs/ref/contrib/gis/geos.txt b/docs/ref/contrib/gis/geos.txt
index 3103768..b5abdd1 100644
--- a/docs/ref/contrib/gis/geos.txt
+++ b/docs/ref/contrib/gis/geos.txt
@@ -482,7 +482,8 @@ the geometry.
 .. attribute:: GEOSGeometry.envelope
 
 Returns a :class:`Polygon` that represents the bounding envelope of
-this geometry.
+this geometry. Note that it can also return a :class:`Point` if the input
+geometry is a point.
 
 .. attribute:: GEOSGeometry.point_on_surface
 
diff --git a/docs/ref/contrib/gis/install/geolibs.txt b/docs/ref/contrib/gis/install/geolibs.txt
index 2b08e04..a7041fc 100644
--- a/docs/ref/contrib/gis/install/geolibs.txt
+++ b/docs/ref/contrib/gis/install/geolibs.txt
@@ -61,7 +61,7 @@ __ http://www.gaia-gis.it/gaia-sins/
 On Debian/Ubuntu, you are advised to install the following packages which will
 install, directly or by dependency, the required geospatial libraries:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ sudo apt-get install binutils libproj-dev gdal-bin
 
diff --git a/docs/ref/contrib/gis/tutorial.txt b/docs/ref/contrib/gis/tutorial.txt
index 327427e..4b20228 100644
--- a/docs/ref/contrib/gis/tutorial.txt
+++ b/docs/ref/contrib/gis/tutorial.txt
@@ -56,7 +56,7 @@ First, create a spatial database for your project.
 If you are using PostGIS, create the database from the :ref:`spatial database
 template <spatialdb_template>`:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ createdb -T template_postgis geodjango
 
@@ -66,7 +66,7 @@ template <spatialdb_template>`:
     create a database.  To create a user with ``CREATE DATABASE`` privileges in
     PostgreSQL, use the following commands:
 
-    .. code-block:: bash
+    .. code-block:: console
 
         $ sudo su - postgres
         $ createuser --createdb geo
@@ -84,14 +84,14 @@ Create a New Project
 Use the standard ``django-admin.py`` script to create a project called
 ``geodjango``:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ django-admin.py startproject geodjango
 
 This will initialize a new project. Now, create a ``world`` Django application
 within the ``geodjango`` project:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ cd geodjango
     $ python manage.py startapp world
@@ -137,7 +137,7 @@ The world borders data is available in this `zip file`__.  Create a ``data``
 directory in the ``world`` application, download the world borders data, and
 unzip. On GNU/Linux platforms, use the following commands:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ mkdir world/data
     $ cd world/data
@@ -166,7 +166,7 @@ Use ``ogrinfo`` to examine spatial data
 The GDAL ``ogrinfo`` utility allows examining the metadata of shapefiles or
 other vector data sources:
 
-.. code-block:: bash
+.. code-block:: console
 
     $ ogrinfo world/data/TM_WORLD_BORDERS-0.3.shp
     INFO: Open of `world/data/TM_WORLD_BORDERS-0.3.shp'
@@ -177,7 +177,7 @@ other vector data sources:
 layer contains polygon data.  To find out more, we'll specify the layer name
 and use the ``-so`` option to get only the important summary information:
 
-.. code-block:: bash
+.. code-block:: console
 
... 1181 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-django.git



More information about the Python-modules-commits mailing list