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

Raphaël Hertzog hertzog at moszumanska.debian.org
Wed Jul 8 23:58:20 UTC 2015


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

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

commit f5e6ce58932854850f185e142ecee78b5cb32864
Author: Raphaël Hertzog <hertzog at debian.org>
Date:   Thu Jul 9 01:51:29 2015 +0200

    Imported Upstream version 1.8.3
---
 Django.egg-info/PKG-INFO                           |   2 +-
 Django.egg-info/SOURCES.txt                        |   7 +-
 PKG-INFO                                           |   2 +-
 django/__init__.py                                 |   2 +-
 django/apps/registry.py                            |   2 +-
 django/conf/__init__.py                            |   6 +-
 django/conf/urls/__init__.py                       |  10 +-
 django/conf/urls/i18n.py                           |   6 +-
 django/contrib/admin/helpers.py                    |   6 +-
 django/contrib/admin/templatetags/admin_list.py    |   2 +-
 django/contrib/admin/views/main.py                 |   2 +-
 django/contrib/auth/views.py                       |   6 +-
 django/contrib/contenttypes/models.py              |   4 +-
 django/contrib/gis/db/models/query.py              |  12 +-
 django/contrib/gis/db/models/sql/aggregates.py     |   2 +-
 django/contrib/postgres/forms/hstore.py            |  10 ++
 django/contrib/postgres/forms/ranges.py            |  11 +-
 django/contrib/sessions/backends/cache.py          |   6 +-
 django/contrib/sessions/backends/cached_db.py      |   4 +-
 django/contrib/sessions/backends/db.py             |   5 +-
 django/contrib/sessions/backends/file.py           |   5 +-
 django/contrib/webdesign/__init__.py               |   6 +-
 django/core/context_processors.py                  |   4 +-
 django/core/files/storage.py                       |   6 +-
 django/core/management/base.py                     |  17 +-
 django/core/management/commands/migrate.py         |   4 +-
 django/core/urlresolvers.py                        |   4 +-
 django/core/validators.py                          |  31 ++--
 django/db/backends/base/creation.py                |   4 +-
 django/db/backends/base/schema.py                  |  19 ++-
 django/db/backends/mysql/schema.py                 |  23 ++-
 django/db/backends/oracle/operations.py            |   2 +-
 django/db/backends/postgresql_psycopg2/schema.py   |  16 +-
 django/db/migrations/executor.py                   |  18 +++
 django/db/migrations/loader.py                     |  34 +++-
 django/db/models/aggregates.py                     |   2 +-
 django/db/models/fields/files.py                   |   6 +-
 django/db/models/fields/related.py                 |  30 +++-
 django/db/models/fields/subclassing.py             |   4 +-
 django/db/models/lookups.py                        |   7 +-
 django/db/models/manager.py                        |   3 +
 django/db/models/options.py                        |   8 +-
 django/db/models/query_utils.py                    |  18 ++-
 django/db/models/sql/aggregates.py                 |   4 +-
 django/db/models/sql/compiler.py                   |   4 +-
 django/db/models/sql/query.py                      |  33 ++--
 django/db/utils.py                                 |   8 +-
 django/forms/fields.py                             |  10 +-
 django/forms/forms.py                              |   6 -
 django/forms/models.py                             |  11 +-
 django/shortcuts.py                                |   6 +-
 django/template/__init__.py                        |   2 +-
 django/template/backends/django.py                 |   8 +-
 django/template/base.py                            |   4 +-
 django/template/context.py                         |  14 +-
 django/template/context_processors.py              |   6 +-
 django/template/defaultfilters.py                  |  41 ++---
 django/template/defaulttags.py                     |  10 +-
 django/template/engine.py                          |  16 +-
 django/template/loader.py                          |  10 +-
 django/template/loaders/base.py                    |   2 +-
 django/template/response.py                        |  14 +-
 django/template/smartif.py                         |   8 +-
 django/template/utils.py                           |   6 +-
 django/templatetags/future.py                      |  10 +-
 django/test/testcases.py                           |  20 ++-
 django/utils/autoreload.py                         |   4 +-
 django/utils/checksums.py                          |   6 +-
 django/utils/dateparse.py                          |   2 +-
 django/utils/deprecation.py                        |   5 +-
 django/utils/functional.py                         |   2 +-
 django/utils/html.py                               |   8 +-
 django/utils/module_loading.py                     |   2 +-
 django/views/decorators/http.py                    |   6 +-
 django/views/generic/edit.py                       |  10 +-
 docs/_ext/literals_to_xrefs.py                     | 174 ---------------------
 docs/faq/install.txt                               |  16 +-
 docs/howto/deployment/checklist.txt                |  18 +++
 docs/howto/writing-migrations.txt                  |  41 +++++
 docs/index.txt                                     |   8 +-
 .../writing-code/submitting-patches.txt            |   2 +-
 .../contributing/writing-code/unit-tests.txt       |   2 +
 .../contributing/writing-documentation.txt         |   8 -
 docs/internals/deprecation.txt                     |   6 +-
 docs/intro/install.txt                             |   6 +-
 docs/intro/tutorial05.txt                          |   5 +-
 docs/ref/class-based-views/mixins-editing.txt      |   4 +-
 docs/ref/clickjacking.txt                          |   3 +
 docs/ref/contrib/admin/index.txt                   |  65 ++++----
 docs/ref/contrib/postgres/fields.txt               |  18 +++
 docs/ref/contrib/sites.txt                         |   3 +-
 docs/ref/contrib/staticfiles.txt                   |   6 +
 docs/ref/contrib/syndication.txt                   |   2 +-
 docs/ref/django-admin.txt                          |  52 +++---
 docs/ref/forms/api.txt                             |  14 +-
 docs/ref/forms/fields.txt                          |  57 +++----
 docs/ref/forms/validation.txt                      |  43 ++---
 docs/ref/forms/widgets.txt                         |  26 +--
 docs/ref/migration-operations.txt                  |   2 +-
 docs/ref/models/database-functions.txt             |  11 ++
 docs/ref/models/expressions.txt                    |   2 +-
 docs/ref/models/fields.txt                         |  17 +-
 docs/ref/models/instances.txt                      |   2 +-
 docs/ref/models/meta.txt                           |   2 +-
 docs/ref/models/options.txt                        |  28 ++--
 docs/ref/models/querysets.txt                      |   7 +-
 docs/ref/request-response.txt                      |   7 +
 docs/ref/settings.txt                              |  94 ++++++-----
 docs/ref/templates/builtins.txt                    |  26 +--
 docs/ref/templates/upgrading.txt                   |   2 +-
 docs/ref/urls.txt                                  |   2 +-
 docs/releases/1.4.21.txt                           |  54 +++++++
 docs/releases/1.5.txt                              |   2 +-
 docs/releases/1.6.txt                              |   3 +-
 docs/releases/1.7.9.txt                            |  65 ++++++++
 docs/releases/1.8.3.txt                            | 155 ++++++++++++++++++
 docs/releases/1.8.txt                              |  47 +++---
 docs/releases/index.txt                            |   3 +
 docs/spelling_wordlist                             |   2 +
 docs/topics/auth/default.txt                       |  24 ++-
 docs/topics/db/multi-db.txt                        |   2 +-
 docs/topics/db/queries.txt                         |   4 +-
 docs/topics/forms/formsets.txt                     |   4 +-
 docs/topics/http/decorators.txt                    |   8 +-
 docs/topics/http/shortcuts.txt                     |   4 +-
 docs/topics/i18n/translation.txt                   |  84 +++++++---
 docs/topics/install.txt                            |   4 +-
 docs/topics/migrations.txt                         |   3 +
 docs/topics/python3.txt                            |   6 +-
 docs/topics/templates.txt                          |   2 +-
 docs/topics/testing/tools.txt                      |   7 +
 tests/admin_changelist/admin.py                    |   2 +-
 tests/admin_changelist/models.py                   |   4 +
 tests/admin_changelist/tests.py                    |  11 +-
 tests/admin_inlines/tests.py                       |   2 +-
 tests/aggregation/tests.py                         |   4 +-
 tests/annotations/tests.py                         |   4 +
 tests/apps/tests.py                                |   2 +-
 tests/auth_tests/test_views.py                     |   4 +-
 tests/commands_sql/tests.py                        |   6 +-
 tests/csrf_tests/test_context_processor.py         |  15 ++
 tests/custom_lookups/tests.py                      |  77 ++++-----
 tests/deprecation/tests.py                         |   2 +-
 tests/expressions_case/tests.py                    |  54 +++++++
 tests/field_subclassing/fields.py                  |   6 +-
 tests/file_storage/tests.py                        |  18 ++-
 .../forms_tests/tests/filepath_test_files/1x1.bmp  | Bin 0 -> 58 bytes
 tests/forms_tests/tests/test_fields.py             |  27 +++-
 tests/generic_inline_admin/models.py               |   2 +-
 tests/generic_inline_admin/tests.py                |  15 +-
 tests/generic_views/test_edit.py                   |  10 +-
 tests/gis_tests/geo3d/tests.py                     |   4 +-
 tests/gis_tests/geoapp/test_sitemaps.py            |   4 +-
 tests/gis_tests/geoapp/tests.py                    |   8 +-
 tests/gis_tests/relatedapp/tests.py                |   8 +-
 tests/i18n/tests.py                                |   7 +-
 tests/i18n/urls.py                                 |   6 +-
 tests/indexes/tests.py                             |   4 +-
 tests/invalid_models_tests/test_models.py          |  26 +--
 tests/invalid_models_tests/test_relative_fields.py |  11 +-
 tests/migrations/test_base.py                      |   6 +
 tests/migrations/test_commands.py                  |   4 +-
 tests/migrations/test_executor.py                  |  45 ++++++
 tests/migrations/test_loader.py                    |  41 ++++-
 tests/model_fields/tests.py                        |   5 +-
 tests/model_formsets/models.py                     |  30 ++++
 tests/model_formsets/test_uuid.py                  |  48 +++++-
 tests/model_meta/test_legacy.py                    |  16 +-
 tests/multiple_database/tests.py                   |   4 +-
 tests/postgres_tests/test_array.py                 |   8 +
 tests/postgres_tests/test_hstore.py                |  13 ++
 tests/postgres_tests/test_ranges.py                |  10 +-
 tests/prefetch_related/models.py                   |  17 ++
 tests/prefetch_related/test_uuid.py                |  95 +++++++++++
 tests/queries/tests.py                             |   9 +-
 tests/queryset_pickle/tests.py                     |  14 ++
 tests/requirements/base.txt                        |   2 +-
 tests/resolve_url/tests.py                         |   4 +-
 tests/runtests.py                                  |  14 +-
 tests/schema/models.py                             |  26 +++
 tests/schema/tests.py                              | 115 +++++++++++++-
 tests/sessions_tests/tests.py                      |  20 +++
 tests/settings_tests/tests.py                      |   2 +-
 tests/shortcuts/tests.py                           |  16 +-
 tests/sitemaps_tests/test_http.py                  |   8 +-
 tests/sitemaps_tests/test_https.py                 |   6 +-
 tests/template_backends/test_django.py             |   4 +-
 .../template_tests/filter_tests/test_removetags.py |   6 +-
 .../filter_tests/test_unordered_list.py            |  15 +-
 tests/template_tests/syntax_tests/test_cycle.py    |   8 +-
 tests/template_tests/syntax_tests/test_firstof.py  |  10 +-
 tests/template_tests/syntax_tests/test_for.py      |  12 +-
 tests/template_tests/syntax_tests/test_if.py       |   8 +-
 tests/template_tests/syntax_tests/test_ssi.py      |   6 +-
 tests/template_tests/syntax_tests/test_url.py      |  40 ++---
 tests/template_tests/test_context.py               |  11 +-
 tests/template_tests/test_custom.py                |   4 +-
 tests/template_tests/test_engine.py                |   6 +-
 tests/template_tests/test_response.py              |   8 +-
 tests/test_client_regress/tests.py                 |   4 +-
 tests/test_utils/tests.py                          |   6 +
 tests/urlpatterns_reverse/erroneous_urls.py        |   6 +-
 .../urlpatterns_reverse/included_namespace_urls.py |   6 +-
 tests/urlpatterns_reverse/tests.py                 |   6 +-
 tests/urlpatterns_reverse/urls.py                  |   6 +-
 .../management/commands/optparse_cmd.py            |   1 +
 tests/user_commands/tests.py                       |   4 +-
 tests/utils_tests/test_checksums.py                |   4 +-
 tests/utils_tests/test_dateparse.py                |  14 ++
 tests/utils_tests/test_html.py                     |   6 +-
 tests/utils_tests/test_module_loading.py           |   4 +-
 tests/validators/invalid_urls.txt                  |   3 +
 tests/validators/tests.py                          |  18 ++-
 tests/validators/valid_urls.txt                    |   2 +
 tests/view_tests/tests/test_csrf.py                |   2 +-
 215 files changed, 2113 insertions(+), 978 deletions(-)

diff --git a/Django.egg-info/PKG-INFO b/Django.egg-info/PKG-INFO
index 98f4f3c..d2924c6 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.8.2
+Version: 1.8.3
 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 3dc6a77..28bf82a 100644
--- a/Django.egg-info/SOURCES.txt
+++ b/Django.egg-info/SOURCES.txt
@@ -3083,7 +3083,6 @@ docs/make.bat
 docs/spelling_wordlist
 docs/_ext/applyxrefs.py
 docs/_ext/djangodocs.py
-docs/_ext/literals_to_xrefs.py
 docs/_ext/ticket_role.py
 docs/_theme/djangodocs/genindex.html
 docs/_theme/djangodocs/layout.html
@@ -3352,6 +3351,7 @@ docs/releases/1.4.18.txt
 docs/releases/1.4.19.txt
 docs/releases/1.4.2.txt
 docs/releases/1.4.20.txt
+docs/releases/1.4.21.txt
 docs/releases/1.4.3.txt
 docs/releases/1.4.4.txt
 docs/releases/1.4.5.txt
@@ -3393,9 +3393,11 @@ docs/releases/1.7.5.txt
 docs/releases/1.7.6.txt
 docs/releases/1.7.7.txt
 docs/releases/1.7.8.txt
+docs/releases/1.7.9.txt
 docs/releases/1.7.txt
 docs/releases/1.8.1.txt
 docs/releases/1.8.2.txt
+docs/releases/1.8.3.txt
 docs/releases/1.8.txt
 docs/releases/index.txt
 docs/releases/security.txt
@@ -3737,6 +3739,7 @@ tests/context_processors/templates/context_processors/request_attrs.html
 tests/createsuperuser/__init__.py
 tests/createsuperuser/tests.py
 tests/csrf_tests/__init__.py
+tests/csrf_tests/test_context_processor.py
 tests/csrf_tests/tests.py
 tests/custom_columns/__init__.py
 tests/custom_columns/models.py
@@ -3933,6 +3936,7 @@ tests/forms_tests/tests/test_validators.py
 tests/forms_tests/tests/test_widgets.py
 tests/forms_tests/tests/tests.py
 tests/forms_tests/tests/filepath_test_files/.dot-file
+tests/forms_tests/tests/filepath_test_files/1x1.bmp
 tests/forms_tests/tests/filepath_test_files/1x1.png
 tests/forms_tests/tests/filepath_test_files/fake-image.jpg
 tests/forms_tests/tests/filepath_test_files/real-text-file.txt
@@ -4548,6 +4552,7 @@ tests/postgres_tests/migrations/0002_create_test_models.py
 tests/postgres_tests/migrations/__init__.py
 tests/prefetch_related/__init__.py
 tests/prefetch_related/models.py
+tests/prefetch_related/test_uuid.py
 tests/prefetch_related/tests.py
 tests/project_template/__init__.py
 tests/project_template/test_settings.py
diff --git a/PKG-INFO b/PKG-INFO
index 98f4f3c..d2924c6 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: Django
-Version: 1.8.2
+Version: 1.8.3
 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 4698fd0..5a3eaed 100644
--- a/django/__init__.py
+++ b/django/__init__.py
@@ -1,6 +1,6 @@
 from django.utils.version import get_version
 
-VERSION = (1, 8, 2, 'final', 0)
+VERSION = (1, 8, 3, 'final', 0)
 
 __version__ = get_version(VERSION)
 
diff --git a/django/apps/registry.py b/django/apps/registry.py
index 0cda55d..2a496af 100644
--- a/django/apps/registry.py
+++ b/django/apps/registry.py
@@ -213,7 +213,7 @@ class Apps(object):
                 warnings.warn(
                     "Model '%s.%s' was already registered. "
                     "Reloading models is not advised as it can lead to inconsistencies, "
-                    "most notably with related models." % (model_name, app_label),
+                    "most notably with related models." % (app_label, model_name),
                     RuntimeWarning, stacklevel=2)
             else:
                 raise RuntimeError(
diff --git a/django/conf/__init__.py b/django/conf/__init__.py
index 7ca099b..c4eb80a 100644
--- a/django/conf/__init__.py
+++ b/django/conf/__init__.py
@@ -13,7 +13,7 @@ import warnings
 
 from django.conf import global_settings
 from django.core.exceptions import ImproperlyConfigured
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
 from django.utils.functional import LazyObject, empty
 from django.utils import six
 
@@ -115,11 +115,11 @@ class Settings(BaseSettings):
         if ('django.contrib.auth.middleware.AuthenticationMiddleware' in self.MIDDLEWARE_CLASSES and
                 'django.contrib.auth.middleware.SessionAuthenticationMiddleware' not in self.MIDDLEWARE_CLASSES):
             warnings.warn(
-                "Session verification will become mandatory in Django 2.0. "
+                "Session verification will become mandatory in Django 1.10. "
                 "Please add 'django.contrib.auth.middleware.SessionAuthenticationMiddleware' "
                 "to your MIDDLEWARE_CLASSES setting when you are ready to opt-in after "
                 "reading the upgrade considerations in the 1.8 release notes.",
-                RemovedInDjango20Warning
+                RemovedInDjango110Warning
             )
 
         if hasattr(time, 'tzset') and self.TIME_ZONE:
diff --git a/django/conf/urls/__init__.py b/django/conf/urls/__init__.py
index 6ed5493..e88440d 100644
--- a/django/conf/urls/__init__.py
+++ b/django/conf/urls/__init__.py
@@ -5,7 +5,7 @@ from django.core.urlresolvers import (RegexURLPattern,
     RegexURLResolver, LocaleRegexURLResolver)
 from django.core.exceptions import ImproperlyConfigured
 from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
 
 
 __all__ = ['handler400', 'handler403', 'handler404', 'handler500', 'include', 'patterns', 'url']
@@ -49,9 +49,9 @@ def include(arg, namespace=None, app_name=None):
 def patterns(prefix, *args):
     warnings.warn(
         'django.conf.urls.patterns() is deprecated and will be removed in '
-        'Django 2.0. Update your urlpatterns to be a list of '
+        'Django 1.10. Update your urlpatterns to be a list of '
         'django.conf.urls.url() instances instead.',
-        RemovedInDjango20Warning, stacklevel=2
+        RemovedInDjango110Warning, stacklevel=2
     )
     pattern_list = []
     for t in args:
@@ -72,9 +72,9 @@ def url(regex, view, kwargs=None, name=None, prefix=''):
         if isinstance(view, six.string_types):
             warnings.warn(
                 'Support for string view arguments to url() is deprecated and '
-                'will be removed in Django 2.0 (got %s). Pass the callable '
+                'will be removed in Django 1.10 (got %s). Pass the callable '
                 'instead.' % view,
-                RemovedInDjango20Warning, stacklevel=2
+                RemovedInDjango110Warning, stacklevel=2
             )
             if not view:
                 raise ImproperlyConfigured('Empty URL pattern view name not permitted (for pattern %r)' % regex)
diff --git a/django/conf/urls/i18n.py b/django/conf/urls/i18n.py
index 9366a5f..44e05b3 100644
--- a/django/conf/urls/i18n.py
+++ b/django/conf/urls/i18n.py
@@ -4,7 +4,7 @@ from django.conf import settings
 from django.conf.urls import patterns, url
 from django.core.urlresolvers import LocaleRegexURLResolver
 from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
 from django.views.i18n import set_language
 
 
@@ -18,9 +18,9 @@ def i18n_patterns(prefix, *args):
         warnings.warn(
             "Calling i18n_patterns() with the `prefix` argument and with tuples "
             "instead of django.conf.urls.url() instances is deprecated and "
-            "will no longer work in Django 2.0. Use a list of "
+            "will no longer work in Django 1.10. Use a list of "
             "django.conf.urls.url() instances instead.",
-            RemovedInDjango20Warning, stacklevel=2
+            RemovedInDjango110Warning, stacklevel=2
         )
         pattern_list = patterns(prefix, *args)
     else:
diff --git a/django/contrib/admin/helpers.py b/django/contrib/admin/helpers.py
index 07ea9a4..e50939b 100644
--- a/django/contrib/admin/helpers.py
+++ b/django/contrib/admin/helpers.py
@@ -14,7 +14,7 @@ from django.db.models.fields.related import ManyToManyRel
 from django.forms.utils import flatatt
 from django.template.defaultfilters import capfirst, linebreaksbr
 from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
 from django.utils.encoding import force_text, smart_text
 from django.utils.functional import cached_property
 from django.utils.html import conditional_escape, format_html
@@ -284,9 +284,9 @@ class InlineAdminForm(AdminForm):
     def original_content_type_id(self):
         warnings.warn(
             'InlineAdminForm.original_content_type_id is deprecated and will be '
-            'removed in Django 2.0. If you were using this attribute to construct '
+            'removed in Django 1.10. If you were using this attribute to construct '
             'the "view on site" URL, use the `absolute_url` attribute instead.',
-            RemovedInDjango20Warning, stacklevel=2
+            RemovedInDjango110Warning, stacklevel=2
         )
         if self.original is not None:
             # Since this module gets imported in the application's root package,
diff --git a/django/contrib/admin/templatetags/admin_list.py b/django/contrib/admin/templatetags/admin_list.py
index 55fba4f..e602133 100644
--- a/django/contrib/admin/templatetags/admin_list.py
+++ b/django/contrib/admin/templatetags/admin_list.py
@@ -200,7 +200,7 @@ def items_for_result(cl, result, form):
         except ObjectDoesNotExist:
             result_repr = EMPTY_CHANGELIST_VALUE
         else:
-            if f is None:
+            if f is None or f.auto_created:
                 if field_name == 'action_checkbox':
                     row_classes = ['action-checkbox']
                 allow_tags = getattr(attr, 'allow_tags', False)
diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py
index c0e59f9..68c7878 100644
--- a/django/contrib/admin/views/main.py
+++ b/django/contrib/admin/views/main.py
@@ -383,7 +383,7 @@ class ChangeList(object):
             except FieldDoesNotExist:
                 pass
             else:
-                if isinstance(field.rel, models.ManyToOneRel):
+                if hasattr(field, 'rel') and isinstance(field.rel, models.ManyToOneRel):
                     return True
         return False
 
diff --git a/django/contrib/auth/views.py b/django/contrib/auth/views.py
index 99363c3..e57d151 100644
--- a/django/contrib/auth/views.py
+++ b/django/contrib/auth/views.py
@@ -16,7 +16,7 @@ from django.core.urlresolvers import reverse
 from django.http import HttpResponseRedirect, QueryDict
 from django.shortcuts import resolve_url
 from django.template.response import TemplateResponse
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
 from django.utils.encoding import force_text
 from django.utils.http import is_safe_url, urlsafe_base64_decode
 from django.utils.six.moves.urllib.parse import urlparse, urlunparse
@@ -175,8 +175,8 @@ def password_reset(request, is_admin_site=False,
                 warnings.warn(
                     "The is_admin_site argument to "
                     "django.contrib.auth.views.password_reset() is deprecated "
-                    "and will be removed in Django 2.0.",
-                    RemovedInDjango20Warning, 3
+                    "and will be removed in Django 1.10.",
+                    RemovedInDjango110Warning, 3
                 )
                 opts = dict(opts, domain_override=request.get_host())
             form.save(**opts)
diff --git a/django/contrib/contenttypes/models.py b/django/contrib/contenttypes/models.py
index 2aadf80..27a5388 100644
--- a/django/contrib/contenttypes/models.py
+++ b/django/contrib/contenttypes/models.py
@@ -5,7 +5,7 @@ import warnings
 from django.apps import apps
 from django.db import models
 from django.db.utils import IntegrityError, OperationalError, ProgrammingError
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
 from django.utils.encoding import force_text, python_2_unicode_compatible
 from django.utils.translation import ugettext_lazy as _
 
@@ -41,7 +41,7 @@ class ContentTypeManager(models.Manager):
             del kwargs['name']
             warnings.warn(
                 "ContentType.name field doesn't exist any longer. Please remove it from your code.",
-                RemovedInDjango20Warning, stacklevel=2)
+                RemovedInDjango110Warning, stacklevel=2)
         return super(ContentTypeManager, self).create(**kwargs)
 
     def get_for_model(self, model, for_concrete_model=True):
diff --git a/django/contrib/gis/db/models/query.py b/django/contrib/gis/db/models/query.py
index f287c77..343610c 100644
--- a/django/contrib/gis/db/models/query.py
+++ b/django/contrib/gis/db/models/query.py
@@ -15,7 +15,7 @@ from django.db.models.expressions import RawSQL
 from django.db.models.fields import Field
 from django.db.models.query import QuerySet
 from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
 
 
 class GeoQuerySet(QuerySet):
@@ -69,7 +69,7 @@ class GeoQuerySet(QuerySet):
         warnings.warn(
             "The collect GeoQuerySet method is deprecated. Use the Collect() "
             "aggregate in an aggregate() or annotate() method.",
-            RemovedInDjango20Warning, stacklevel=2
+            RemovedInDjango110Warning, stacklevel=2
         )
         return self._spatial_aggregate(aggregates.Collect, **kwargs)
 
@@ -114,7 +114,7 @@ class GeoQuerySet(QuerySet):
         warnings.warn(
             "The extent GeoQuerySet method is deprecated. Use the Extent() "
             "aggregate in an aggregate() or annotate() method.",
-            RemovedInDjango20Warning, stacklevel=2
+            RemovedInDjango110Warning, stacklevel=2
         )
         return self._spatial_aggregate(aggregates.Extent, **kwargs)
 
@@ -127,7 +127,7 @@ class GeoQuerySet(QuerySet):
         warnings.warn(
             "The extent3d GeoQuerySet method is deprecated. Use the Extent3D() "
             "aggregate in an aggregate() or annotate() method.",
-            RemovedInDjango20Warning, stacklevel=2
+            RemovedInDjango110Warning, stacklevel=2
         )
         return self._spatial_aggregate(aggregates.Extent3D, **kwargs)
 
@@ -234,7 +234,7 @@ class GeoQuerySet(QuerySet):
         warnings.warn(
             "The make_line GeoQuerySet method is deprecated. Use the MakeLine() "
             "aggregate in an aggregate() or annotate() method.",
-            RemovedInDjango20Warning, stacklevel=2
+            RemovedInDjango110Warning, stacklevel=2
         )
         return self._spatial_aggregate(aggregates.MakeLine, geo_field_type=PointField, **kwargs)
 
@@ -422,7 +422,7 @@ class GeoQuerySet(QuerySet):
         warnings.warn(
             "The unionagg GeoQuerySet method is deprecated. Use the Union() "
             "aggregate in an aggregate() or annotate() method.",
-            RemovedInDjango20Warning, stacklevel=2
+            RemovedInDjango110Warning, stacklevel=2
         )
         return self._spatial_aggregate(aggregates.Union, **kwargs)
 
diff --git a/django/contrib/gis/db/models/sql/aggregates.py b/django/contrib/gis/db/models/sql/aggregates.py
index b83bafd..e3fb049 100644
--- a/django/contrib/gis/db/models/sql/aggregates.py
+++ b/django/contrib/gis/db/models/sql/aggregates.py
@@ -7,4 +7,4 @@ __all__ = ['Collect', 'Extent', 'Extent3D', 'MakeLine', 'Union'] + aggregates.__
 warnings.warn(
     "django.contrib.gis.db.models.sql.aggregates is deprecated. Use "
     "django.contrib.gis.db.models.aggregates instead.",
-    RemovedInDjango20Warning, stacklevel=2)
+    RemovedInDjango110Warning, stacklevel=2)
diff --git a/django/contrib/postgres/forms/hstore.py b/django/contrib/postgres/forms/hstore.py
index 2c564ea..a138093 100644
--- a/django/contrib/postgres/forms/hstore.py
+++ b/django/contrib/postgres/forms/hstore.py
@@ -34,3 +34,13 @@ class HStoreField(forms.CharField):
         for key, val in value.items():
             value[key] = six.text_type(val)
         return value
+
+    def has_changed(self, initial, data):
+        """
+        Return True if data differs from initial.
+        """
+        # For purposes of seeing whether something has changed, None is
+        # the same as an empty dict, if the data or initial value we get
+        # is None, replace it w/ {}.
+        initial_value = self.to_python(initial)
+        return super(forms.HStoreField, self).has_changed(initial_value, data)
diff --git a/django/contrib/postgres/forms/ranges.py b/django/contrib/postgres/forms/ranges.py
index cab2267..75e5691 100644
--- a/django/contrib/postgres/forms/ranges.py
+++ b/django/contrib/postgres/forms/ranges.py
@@ -22,10 +22,17 @@ class BaseRangeField(forms.MultiValueField):
         super(BaseRangeField, self).__init__(**kwargs)
 
     def prepare_value(self, value):
+        lower_base, upper_base = self.fields
         if isinstance(value, self.range_type):
-            return [value.lower, value.upper]
+            return [
+                lower_base.prepare_value(value.lower),
+                upper_base.prepare_value(value.upper),
+            ]
         if value is None:
-            return [None, None]
+            return [
+                lower_base.prepare_value(None),
+                upper_base.prepare_value(None),
+            ]
         return value
 
     def compress(self, values):
diff --git a/django/contrib/sessions/backends/cache.py b/django/contrib/sessions/backends/cache.py
index 38b6112..5bc4dc1 100644
--- a/django/contrib/sessions/backends/cache.py
+++ b/django/contrib/sessions/backends/cache.py
@@ -27,7 +27,7 @@ class SessionStore(SessionBase):
             session_data = None
         if session_data is not None:
             return session_data
-        self.create()
+        self._session_key = None
         return {}
 
     def create(self):
@@ -49,6 +49,8 @@ class SessionStore(SessionBase):
             "It is likely that the cache is unavailable.")
 
     def save(self, must_create=False):
+        if self.session_key is None:
+            return self.create()
         if must_create:
             func = self._cache.add
         else:
@@ -60,7 +62,7 @@ class SessionStore(SessionBase):
             raise CreateError
 
     def exists(self, session_key):
-        return (KEY_PREFIX + session_key) in self._cache
+        return session_key and (KEY_PREFIX + session_key) in self._cache
 
     def delete(self, session_key=None):
         if session_key is None:
diff --git a/django/contrib/sessions/backends/cached_db.py b/django/contrib/sessions/backends/cached_db.py
index 0ba12f5..4358065 100644
--- a/django/contrib/sessions/backends/cached_db.py
+++ b/django/contrib/sessions/backends/cached_db.py
@@ -51,12 +51,12 @@ class SessionStore(DBStore):
                     logger = logging.getLogger('django.security.%s' %
                             e.__class__.__name__)
                     logger.warning(force_text(e))
-                self.create()
+                self._session_key = None
                 data = {}
         return data
 
     def exists(self, session_key):
-        if (KEY_PREFIX + session_key) in self._cache:
+        if session_key and (KEY_PREFIX + session_key) in self._cache:
             return True
         return super(SessionStore, self).exists(session_key)
 
diff --git a/django/contrib/sessions/backends/db.py b/django/contrib/sessions/backends/db.py
index 4504591..2d859d3 100644
--- a/django/contrib/sessions/backends/db.py
+++ b/django/contrib/sessions/backends/db.py
@@ -26,7 +26,7 @@ class SessionStore(SessionBase):
                 logger = logging.getLogger('django.security.%s' %
                         e.__class__.__name__)
                 logger.warning(force_text(e))
-            self.create()
+            self._session_key = None
             return {}
 
     def exists(self, session_key):
@@ -43,7 +43,6 @@ class SessionStore(SessionBase):
                 # Key wasn't unique. Try again.
                 continue
             self.modified = True
-            self._session_cache = {}
             return
 
     def save(self, must_create=False):
@@ -53,6 +52,8 @@ class SessionStore(SessionBase):
         create a *new* entry (as opposed to possibly updating an existing
         entry).
         """
+        if self.session_key is None:
+            return self.create()
         obj = Session(
             session_key=self._get_or_create_session_key(),
             session_data=self.encode(self._get_session(no_load=must_create)),
diff --git a/django/contrib/sessions/backends/file.py b/django/contrib/sessions/backends/file.py
index 10d163a..41469c4 100644
--- a/django/contrib/sessions/backends/file.py
+++ b/django/contrib/sessions/backends/file.py
@@ -97,7 +97,7 @@ class SessionStore(SessionBase):
                     self.delete()
                     self.create()
         except (IOError, SuspiciousOperation):
-            self.create()
+            self._session_key = None
         return session_data
 
     def create(self):
@@ -108,10 +108,11 @@ class SessionStore(SessionBase):
             except CreateError:
                 continue
             self.modified = True
-            self._session_cache = {}
             return
 
     def save(self, must_create=False):
+        if self.session_key is None:
+            return self.create()
         # Get the session data now, before we start messing
         # with the file it is stored within.
         session_data = self._get_session(no_load=must_create)
diff --git a/django/contrib/webdesign/__init__.py b/django/contrib/webdesign/__init__.py
index 635ed88..eacf096 100644
--- a/django/contrib/webdesign/__init__.py
+++ b/django/contrib/webdesign/__init__.py
@@ -1,11 +1,11 @@
 import warnings
 
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
 
 default_app_config = 'django.contrib.webdesign.apps.WebDesignConfig'
 
 warnings.warn(
-    "django.contrib.webdesign will be removed in Django 2.0. The "
+    "django.contrib.webdesign will be removed in Django 1.10. The "
     "{% lorem %} tag is now included in the built-in tags.",
-    RemovedInDjango20Warning
+    RemovedInDjango110Warning
 )
diff --git a/django/core/context_processors.py b/django/core/context_processors.py
index f2303be..f106439 100644
--- a/django/core/context_processors.py
+++ b/django/core/context_processors.py
@@ -1,9 +1,9 @@
 import warnings
 
 from django.template.context_processors import *  # NOQA
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
 
 warnings.warn(
     "django.core.context_processors is deprecated in favor of "
     "django.template.context_processors.",
-    RemovedInDjango20Warning, stacklevel=2)
+    RemovedInDjango110Warning, stacklevel=2)
diff --git a/django/core/files/storage.py b/django/core/files/storage.py
index 65b6d46..e611d3a 100644
--- a/django/core/files/storage.py
+++ b/django/core/files/storage.py
@@ -11,7 +11,7 @@ from django.core.files.move import file_move_safe
 from django.utils._os import abspathu, safe_join
 from django.utils.crypto import get_random_string
 from django.utils.deconstruct import deconstructible
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
 from django.utils.encoding import filepath_to_uri, force_text
 from django.utils.functional import LazyObject
 from django.utils.module_loading import import_string
@@ -56,8 +56,8 @@ class Storage(object):
             warnings.warn(
                 'Backwards compatibility for storage backends without '
                 'support for the `max_length` argument in '
-                'Storage.get_available_name() will be removed in Django 2.0.',
-                RemovedInDjango20Warning, stacklevel=2
+                'Storage.get_available_name() will be removed in Django 1.10.',
+                RemovedInDjango110Warning, stacklevel=2
             )
             name = self.get_available_name(name)
 
diff --git a/django/core/management/base.py b/django/core/management/base.py
index 0a4a1ee..558cc32 100644
--- a/django/core/management/base.py
+++ b/django/core/management/base.py
@@ -18,7 +18,7 @@ from django.core.exceptions import ImproperlyConfigured
 from django.core.management.color import color_style, no_style
 from django.db import connections
 from django.utils.deprecation import (
-    RemovedInDjango19Warning, RemovedInDjango20Warning,
+    RemovedInDjango19Warning, RemovedInDjango110Warning,
 )
 from django.utils.encoding import force_str
 
@@ -174,7 +174,7 @@ class BaseCommand(object):
     ``option_list``
         This is the list of ``optparse`` options which will be fed
         into the command's ``OptionParser`` for parsing arguments.
-        Deprecated and will be removed in Django 2.0.
+        Deprecated and will be removed in Django 1.10.
 
     ``output_transaction``
         A boolean indicating whether the command outputs SQL
@@ -300,15 +300,18 @@ class BaseCommand(object):
 
         """
         if not self.use_argparse:
+            def store_as_int(option, opt_str, value, parser):
+                setattr(parser.values, option.dest, int(value))
+
             # Backwards compatibility: use deprecated optparse module
             warnings.warn("OptionParser usage for Django management commands "
                           "is deprecated, use ArgumentParser instead",
-                          RemovedInDjango20Warning)
+                          RemovedInDjango110Warning)
             parser = OptionParser(prog=prog_name,
                                 usage=self.usage(subcommand),
                                 version=self.get_version())
-            parser.add_option('-v', '--verbosity', action='store', dest='verbosity', default='1',
-                type='choice', choices=['0', '1', '2', '3'],
+            parser.add_option('-v', '--verbosity', action='callback', dest='verbosity', default=1,
+                type='choice', choices=['0', '1', '2', '3'], callback=store_as_int,
                 help='Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output')
             parser.add_option('--settings',
                 help=(
@@ -645,9 +648,9 @@ class NoArgsCommand(BaseCommand):
 
     def __init__(self):
         warnings.warn(
-            "NoArgsCommand class is deprecated and will be removed in Django 2.0. "
+            "NoArgsCommand class is deprecated and will be removed in Django 1.10. "
             "Use BaseCommand instead, which takes no arguments by default.",
-            RemovedInDjango20Warning
+            RemovedInDjango110Warning
         )
         super(NoArgsCommand, self).__init__()
 
diff --git a/django/core/management/commands/migrate.py b/django/core/management/commands/migrate.py
index 720cf39..b372369 100644
--- a/django/core/management/commands/migrate.py
+++ b/django/core/management/commands/migrate.py
@@ -20,7 +20,7 @@ from django.db.migrations.autodetector import MigrationAutodetector
 from django.db.migrations.executor import MigrationExecutor
 from django.db.migrations.loader import AmbiguityError
 from django.db.migrations.state import ProjectState
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
 from django.utils.module_loading import module_has_submodule
 
 
@@ -73,7 +73,7 @@ class Command(BaseCommand):
         if options.get("list", False):
             warnings.warn(
                 "The 'migrate --list' command is deprecated. Use 'showmigrations' instead.",
-                RemovedInDjango20Warning, stacklevel=2)
+                RemovedInDjango110Warning, stacklevel=2)
             self.stdout.ending = None  # Remove when #21429 is fixed
             return call_command(
                 'showmigrations',
diff --git a/django/core/urlresolvers.py b/django/core/urlresolvers.py
index f7cb132..f7753cf 100644
--- a/django/core/urlresolvers.py
+++ b/django/core/urlresolvers.py
@@ -18,7 +18,7 @@ from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
 from django.http import Http404
 from django.utils import lru_cache, six
 from django.utils.datastructures import MultiValueDict
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
 from django.utils.encoding import force_str, force_text, iri_to_uri
 from django.utils.functional import lazy
 from django.utils.http import RFC3986_SUBDELIMS, urlquote
@@ -442,7 +442,7 @@ class RegexURLResolver(LocaleRegexProvider):
             if not callable(original_lookup) and callable(lookup_view):
                 warnings.warn(
                     'Reversing by dotted path is deprecated (%s).' % original_lookup,
-                    RemovedInDjango20Warning, stacklevel=3
+                    RemovedInDjango110Warning, stacklevel=3
                 )
         possibilities = self.reverse_dict.getlist(lookup_view)
 
diff --git a/django/core/validators.py b/django/core/validators.py
index bb8224f..cd5b16b 100644
--- a/django/core/validators.py
+++ b/django/core/validators.py
@@ -73,8 +73,8 @@ class URLValidator(RegexValidator):
 
     # Host patterns
     hostname_re = r'[a-z' + ul + r'0-9](?:[a-z' + ul + r'0-9-]*[a-z' + ul + r'0-9])?'
-    domain_re = r'(?:\.[a-z' + ul + r'0-9]+(?:[a-z' + ul + r'0-9-]*[a-z' + ul + r'0-9]+)*)*'
-    tld_re = r'\.[a-z' + ul + r']{2,}\.?'
+    domain_re = r'(?:\.(?!-)[a-z' + ul + r'0-9-]*(?<!-))*'
+    tld_re = r'\.(?:[a-z' + ul + r']{2,}|xn--[a-z0-9]+)\.?'
     host_re = '(' + hostname_re + domain_re + tld_re + '|localhost)'
 
     regex = re.compile(
@@ -83,7 +83,7 @@ class URLValidator(RegexValidator):
         r'(?:' + ipv4_re + '|' + ipv6_re + '|' + host_re + ')'
         r'(?::\d{2,5})?'  # port
         r'(?:[/?#][^\s]*)?'  # resource path
-        r'$', re.IGNORECASE)
+        r'\Z', re.IGNORECASE)
     message = _('Enter a valid URL.')
     schemes = ['http', 'https', 'ftp', 'ftps']
 
@@ -125,12 +125,15 @@ class URLValidator(RegexValidator):
                     raise ValidationError(self.message, code=self.code)
             url = value
 
+integer_validator = RegexValidator(
+    re.compile('^-?\d+\Z'),
+    message=_('Enter a valid integer.'),
+    code='invalid',
+)
+
 
 def validate_integer(value):
-    try:
-        int(value)
-    except (ValueError, TypeError):
-        raise ValidationError(_('Enter a valid integer.'), code='invalid')
+    return integer_validator(value)
 
 
 @deconstructible
@@ -138,17 +141,17 @@ class EmailValidator(object):
     message = _('Enter a valid email address.')
     code = 'invalid'
     user_regex = re.compile(
-        r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*$"  # dot-atom
-        r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"$)',  # quoted-string
+        r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*\Z"  # dot-atom
+        r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"\Z)',  # quoted-string
         re.IGNORECASE)
     domain_regex = re.compile(
         # max length of the domain is 249: 254 (max email length) minus one
         # period, two characters for the TLD, @ sign, & one character before @.
-        r'(?:[A-Z0-9](?:[A-Z0-9-]{0,247}[A-Z0-9])?\.)+(?:[A-Z]{2,6}|[A-Z0-9-]{2,}(?<!-))$',
+        r'(?:[A-Z0-9](?:[A-Z0-9-]{0,247}[A-Z0-9])?\.)+(?:[A-Z]{2,6}|[A-Z0-9-]{2,}(?<!-))\Z',
         re.IGNORECASE)
     literal_regex = re.compile(
         # literal form, ipv4 or ipv6 address (SMTP 4.1.3)
-        r'\[([A-f0-9:\.]+)\]$',
+        r'\[([A-f0-9:\.]+)\]\Z',
         re.IGNORECASE)
     domain_whitelist = ['localhost']
 
@@ -206,14 +209,14 @@ class EmailValidator(object):
 
 validate_email = EmailValidator()
 
-slug_re = re.compile(r'^[-a-zA-Z0-9_]+$')
+slug_re = re.compile(r'^[-a-zA-Z0-9_]+\Z')
 validate_slug = RegexValidator(
     slug_re,
     _("Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens."),
     'invalid'
 )
 
-ipv4_re = re.compile(r'^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$')
+ipv4_re = re.compile(r'^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\Z')
 validate_ipv4_address = RegexValidator(ipv4_re, _('Enter a valid IPv4 address.'), 'invalid')
 
 
@@ -254,7 +257,7 @@ def ip_address_validators(protocol, unpack_ipv4):
         raise ValueError("The protocol '%s' is unknown. Supported: %s"
                          % (protocol, list(ip_address_validator_map)))
 
-comma_separated_int_list_re = re.compile('^[\d,]+$')
+comma_separated_int_list_re = re.compile('^[\d,]+\Z')
 validate_comma_separated_integer_list = RegexValidator(
     comma_separated_int_list_re,
     _('Enter only digits separated by commas.'),
diff --git a/django/db/backends/base/creation.py b/django/db/backends/base/creation.py
index 2c803e5..72eb345 100644
--- a/django/db/backends/base/creation.py
+++ b/django/db/backends/base/creation.py
@@ -8,7 +8,7 @@ from django.conf import settings
 from django.core import serializers
 from django.db import router
 from django.db.backends.utils import truncate_name
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
 from django.utils.encoding import force_bytes
 from django.utils.six import StringIO
 from django.utils.six.moves import input
@@ -191,7 +191,7 @@ class BaseDatabaseCreation(object):
         """
         warnings.warn("DatabaseCreation.sql_indexes_for_model is deprecated, "
                       "use the equivalent method of the schema editor instead.",
-                      RemovedInDjango20Warning)
+                      RemovedInDjango110Warning)
... 7509 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