[Python-modules-commits] [python-django] 01/01: Imported Upstream version 1.7.2
Brian May
bam at moszumanska.debian.org
Mon Jan 5 04:11:41 UTC 2015
This is an automated email from the git hooks/post-receive script.
bam pushed a commit to branch upstream/1.7.x
in repository python-django.
commit 4fc60137203b15d78bf73a5017f98b076ce12259
Author: Brian May <brian at microcomaustralia.com.au>
Date: Mon Jan 5 13:52:13 2015 +1100
Imported Upstream version 1.7.2
---
Django.egg-info/PKG-INFO | 4 +-
Django.egg-info/SOURCES.txt | 40 +-
PKG-INFO | 4 +-
django/__init__.py | 2 +-
django/apps/registry.py | 14 +-
django/conf/locale/ko/LC_MESSAGES/django.mo | Bin 21044 -> 21056 bytes
django/conf/locale/ko/LC_MESSAGES/django.po | 19 +-
django/conf/locale/uk/formats.py | 2 +-
django/contrib/admin/actions.py | 21 +-
django/contrib/admin/checks.py | 7 +-
django/contrib/admin/options.py | 23 +-
django/contrib/admin/sites.py | 4 +-
.../contrib/admin/static/admin/js/SelectFilter2.js | 2 +-
django/contrib/admindocs/views.py | 17 +-
django/contrib/auth/__init__.py | 15 +-
django/contrib/auth/middleware.py | 20 +-
django/contrib/auth/tests/test_forms.py | 2 +-
django/contrib/auth/tests/test_middleware.py | 51 +-
django/contrib/gis/db/backends/mysql/schema.py | 7 +
.../contrib/gis/db/backends/spatialite/creation.py | 3 +-
django/contrib/gis/db/models/fields.py | 2 +-
django/contrib/gis/db/models/proxy.py | 2 +-
django/contrib/gis/db/models/sql/query.py | 2 +-
django/contrib/gis/gdal/srs.py | 2 +-
django/contrib/gis/tests/geoapp/tests.py | 19 +-
.../gis/tests/gis_migrations/test_operations.py | 29 +
django/contrib/sites/management.py | 10 +-
django/contrib/sites/tests.py | 61 +-
django/contrib/webdesign/tests.py | 4 +-
django/core/exceptions.py | 5 +-
django/core/files/base.py | 7 +-
django/core/management/commands/flush.py | 10 +-
django/core/management/commands/makemessages.py | 2 +-
django/core/management/commands/migrate.py | 3 +-
django/core/management/commands/runserver.py | 4 +-
.../core/management/commands/sqlsequencereset.py | 2 -
.../core/management/commands/squashmigrations.py | 32 +-
django/core/serializers/xml_serializer.py | 2 +-
django/db/backends/mysql/base.py | 3 +-
django/db/backends/mysql/validation.py | 4 +
django/db/backends/oracle/creation.py | 4 +-
django/db/backends/postgresql_psycopg2/schema.py | 22 +
django/db/backends/schema.py | 162 +--
django/db/backends/sqlite3/schema.py | 28 +-
django/db/migrations/autodetector.py | 74 +-
django/db/migrations/executor.py | 17 +-
django/db/migrations/graph.py | 65 +-
django/db/migrations/loader.py | 8 +-
django/db/migrations/migration.py | 6 +-
django/db/migrations/operations/base.py | 4 +-
django/db/migrations/operations/fields.py | 26 +-
django/db/migrations/operations/models.py | 31 +-
django/db/migrations/optimizer.py | 9 +-
django/db/migrations/questioner.py | 8 +-
django/db/migrations/state.py | 19 +-
django/db/migrations/writer.py | 59 +-
django/db/models/base.py | 12 +-
django/db/models/fields/__init__.py | 8 +-
django/db/models/fields/related.py | 6 +-
django/db/models/sql/compiler.py | 2 +-
django/db/models/sql/query.py | 55 +-
django/db/utils.py | 2 +-
django/forms/fields.py | 17 +-
django/forms/models.py | 19 +-
django/template/base.py | 4 +-
django/template/debug.py | 4 +-
django/template/defaultfilters.py | 6 +-
django/utils/datetime_safe.py | 12 +-
django/utils/decorators.py | 2 +-
django/utils/html.py | 10 +-
django/utils/safestring.py | 10 +-
django/utils/six.py | 348 +++--
django/utils/text.py | 6 +-
docs/Makefile | 7 +-
.../static/docicons-behindscenes.png | Bin 2269 -> 49 bytes
.../djangodocs-epub/static/docicons-note.png | Bin 1013 -> 41 bytes
.../djangodocs-epub/static/docicons-philosophy.png | Bin 1523 -> 47 bytes
.../djangodocs-epub/static/docicons-warning.png | Bin 782 -> 44 bytes
docs/conf.py | 1 -
docs/faq/install.txt | 6 +-
docs/howto/custom-file-storage.txt | 17 +-
docs/howto/custom-lookups.txt | 23 +-
docs/howto/custom-management-commands.txt | 6 +
docs/howto/deployment/wsgi/modwsgi.txt | 18 +-
docs/howto/deployment/wsgi/uwsgi.txt | 2 +-
docs/howto/error-reporting.txt | 12 +-
docs/howto/initial-data.txt | 4 +-
docs/howto/windows.txt | 4 +-
.../contributing/writing-code/unit-tests.txt | 10 +-
docs/internals/deprecation.txt | 4 -
docs/internals/release-process.txt | 10 +-
docs/intro/reusable-apps.txt | 21 +-
docs/intro/tutorial02.txt | 9 +-
docs/intro/tutorial03.txt | 2 +-
docs/ref/applications.txt | 2 +-
docs/ref/checks.txt | 7 +
docs/ref/contrib/admin/admindocs.txt | 11 +-
docs/ref/contrib/admin/index.txt | 67 +-
docs/ref/contrib/gis/admin.txt | 2 +-
docs/ref/contrib/gis/geos.txt | 12 +-
docs/ref/contrib/gis/install/geolibs.txt | 5 +-
docs/ref/contrib/gis/install/index.txt | 9 +-
docs/ref/contrib/gis/install/spatialite.txt | 39 +-
docs/ref/contrib/gis/testing.txt | 12 -
docs/ref/contrib/sites.txt | 4 +-
docs/ref/databases.txt | 31 +-
docs/ref/django-admin.txt | 23 +-
docs/ref/files/storage.txt | 19 +-
docs/ref/forms/api.txt | 2 +-
docs/ref/forms/formsets.txt | 2 +-
docs/ref/forms/validation.txt | 9 +-
docs/ref/models/fields.txt | 38 +-
docs/ref/models/instances.txt | 28 +-
docs/ref/models/options.txt | 4 +-
docs/ref/models/querysets.txt | 58 +-
docs/ref/request-response.txt | 14 +-
docs/ref/settings.txt | 23 +-
docs/ref/signals.txt | 9 +
docs/ref/templates/api.txt | 27 +-
docs/ref/templates/builtins.txt | 46 +-
docs/ref/utils.txt | 6 +-
docs/releases/1.0-alpha-1.txt | 161 ---
docs/releases/1.0-alpha-2.txt | 135 --
docs/releases/1.0-beta-2.txt | 119 --
docs/releases/1.0-beta.txt | 153 ---
docs/releases/1.1-alpha-1.txt | 165 ---
docs/releases/1.1-beta-1.txt | 208 ---
docs/releases/1.1-rc-1.txt | 109 --
docs/releases/1.2-alpha-1.txt | 588 ---------
docs/releases/1.2-beta-1.txt | 173 ---
docs/releases/1.2-rc-1.txt | 101 --
docs/releases/1.3-alpha-1.txt | 397 ------
docs/releases/1.3-beta-1.txt | 231 ----
docs/releases/1.4-alpha-1.txt | 1125 ----------------
docs/releases/1.4-beta-1.txt | 1197 -----------------
docs/releases/1.4.17.txt | 17 +
docs/releases/1.5-alpha-1.txt | 634 ---------
docs/releases/1.5-beta-1.txt | 706 ----------
docs/releases/1.5.12.txt | 14 +
docs/releases/1.5.txt | 28 +-
docs/releases/1.6.9.txt | 16 +
docs/releases/1.6.txt | 49 +-
docs/releases/1.7.2.txt | 194 +++
docs/releases/1.7.txt | 32 +-
docs/releases/index.txt | 29 +-
docs/releases/security.txt | 4 +-
docs/spelling_wordlist | 1 +
docs/topics/auth/customizing.txt | 6 +-
docs/topics/auth/default.txt | 9 +-
docs/topics/auth/passwords.txt | 2 +-
docs/topics/cache.txt | 19 +-
docs/topics/checks.txt | 5 +-
docs/topics/db/aggregation.txt | 11 +
docs/topics/db/models.txt | 17 +
docs/topics/db/sql.txt | 2 +-
docs/topics/db/transactions.txt | 2 +-
docs/topics/email.txt | 15 +-
docs/topics/forms/formsets.txt | 2 +-
docs/topics/forms/index.txt | 26 +-
docs/topics/forms/modelforms.txt | 7 +-
docs/topics/http/sessions.txt | 4 +-
docs/topics/i18n/translation.txt | 2 +-
docs/topics/migrations.txt | 39 +-
docs/topics/python3.txt | 23 +-
docs/topics/serialization.txt | 12 +-
docs/topics/signals.txt | 7 +
docs/topics/templates.txt | 19 +-
docs/topics/testing/advanced.txt | 82 +-
docs/topics/testing/tools.txt | 30 +-
setup.cfg | 2 +-
setup.py | 2 +-
tests/admin_checks/tests.py | 34 +-
tests/{admin_util => admin_utils}/__init__.py | 0
tests/{admin_util => admin_utils}/models.py | 0
tests/{admin_util => admin_utils}/tests.py | 2 +-
tests/admin_validation/tests.py | 4 +-
tests/admin_views/admin.py | 33 +-
tests/admin_views/models.py | 36 +-
tests/admin_views/tests.py | 90 +-
tests/admin_widgets/tests.py | 2 +-
tests/apps/tests.py | 40 +
tests/backends/tests.py | 4 +-
tests/commands_sql/tests.py | 2 +-
tests/custom_columns_regress/tests.py | 2 +-
tests/custom_lookups/models.py | 8 +
tests/custom_lookups/tests.py | 34 +-
tests/expressions/tests.py | 2 +-
tests/field_deconstruction/tests.py | 12 -
tests/files/tests.py | 11 +-
.../{admin_util => fixtures_migration}/__init__.py | 0
.../fixtures_migration/fixtures/initial_data.json | 9 +
.../fixtures_migration/migrations/0001_initial.py | 16 +
.../migrations}/__init__.py | 0
tests/fixtures_migration/models.py | 5 +
tests/fixtures_migration/tests.py | 34 +
tests/forms_tests/tests/test_forms.py | 16 +
.../tests/{test_util.py => test_utils.py} | 28 +-
tests/i18n/test_extraction.py | 8 +
tests/indexes/tests.py | 47 +-
tests/invalid_models_tests/test_custom_fields.py | 20 +
.../custom_migrations}/__init__.py | 0
tests/migrate_signals/tests.py | 22 +-
tests/migrations/test_autodetector.py | 1357 ++++++++++++--------
tests/migrations/test_base.py | 6 +-
tests/migrations/test_commands.py | 68 +-
tests/migrations/test_executor.py | 96 +-
tests/migrations/test_graph.py | 41 +
tests/migrations/test_operations.py | 65 +-
tests/migrations/test_writer.py | 20 +
tests/model_fields/models.py | 2 +-
tests/model_fields/tests.py | 4 +
tests/model_forms/models.py | 2 +
tests/model_forms/tests.py | 29 +-
tests/model_inheritance/tests.py | 2 +-
tests/model_options/test_tablespaces.py | 44 +-
tests/model_regress/tests.py | 44 +
tests/{admin_util => project_template}/__init__.py | 0
tests/project_template/test_settings.py | 29 +
tests/project_template/urls.py | 7 +
tests/project_template/views.py | 5 +
tests/queries/models.py | 15 +
tests/queries/tests.py | 61 +-
tests/requirements/mysql.txt | 2 +-
tests/schema/models.py | 12 +
tests/schema/tests.py | 89 +-
tests/serializers_regress/tests.py | 4 +-
tests/signed_cookies_tests/tests.py | 2 +-
tests/staticfiles_tests/tests.py | 4 +-
tests/template_tests/test_nodelist.py | 17 +-
tests/test_utils/views.py | 4 +-
tests/update_only_fields/tests.py | 2 +-
tests/utils_tests/test_datetime_safe.py | 9 +-
tests/utils_tests/test_safestring.py | 49 +-
tests/validation/tests.py | 2 +-
tests/view_tests/tests/test_i18n.py | 7 +-
235 files changed, 3950 insertions(+), 7794 deletions(-)
diff --git a/Django.egg-info/PKG-INFO b/Django.egg-info/PKG-INFO
index 34d27a9..83b4829 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.1
+Version: 1.7.2
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
@@ -8,7 +8,7 @@ Author-email: foundation at djangoproject.com
License: BSD
Description: UNKNOWN
Platform: UNKNOWN
-Classifier: Development Status :: 4 - Beta
+Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
diff --git a/Django.egg-info/SOURCES.txt b/Django.egg-info/SOURCES.txt
index 6de531a..e629edf 100644
--- a/Django.egg-info/SOURCES.txt
+++ b/Django.egg-info/SOURCES.txt
@@ -3948,24 +3948,14 @@ docs/ref/templates/builtins.txt
docs/ref/templates/index.txt
docs/releases/0.95.txt
docs/releases/0.96.txt
-docs/releases/1.0-alpha-1.txt
-docs/releases/1.0-alpha-2.txt
-docs/releases/1.0-beta-2.txt
-docs/releases/1.0-beta.txt
docs/releases/1.0-porting-guide.txt
docs/releases/1.0.1.txt
docs/releases/1.0.2.txt
docs/releases/1.0.txt
-docs/releases/1.1-alpha-1.txt
-docs/releases/1.1-beta-1.txt
-docs/releases/1.1-rc-1.txt
docs/releases/1.1.2.txt
docs/releases/1.1.3.txt
docs/releases/1.1.4.txt
docs/releases/1.1.txt
-docs/releases/1.2-alpha-1.txt
-docs/releases/1.2-beta-1.txt
-docs/releases/1.2-rc-1.txt
docs/releases/1.2.1.txt
docs/releases/1.2.2.txt
docs/releases/1.2.3.txt
@@ -3974,8 +3964,6 @@ docs/releases/1.2.5.txt
docs/releases/1.2.6.txt
docs/releases/1.2.7.txt
docs/releases/1.2.txt
-docs/releases/1.3-alpha-1.txt
-docs/releases/1.3-beta-1.txt
docs/releases/1.3.1.txt
docs/releases/1.3.2.txt
docs/releases/1.3.3.txt
@@ -3984,8 +3972,6 @@ docs/releases/1.3.5.txt
docs/releases/1.3.6.txt
docs/releases/1.3.7.txt
docs/releases/1.3.txt
-docs/releases/1.4-alpha-1.txt
-docs/releases/1.4-beta-1.txt
docs/releases/1.4.1.txt
docs/releases/1.4.10.txt
docs/releases/1.4.11.txt
@@ -3994,6 +3980,7 @@ docs/releases/1.4.13.txt
docs/releases/1.4.14.txt
docs/releases/1.4.15.txt
docs/releases/1.4.16.txt
+docs/releases/1.4.17.txt
docs/releases/1.4.2.txt
docs/releases/1.4.3.txt
docs/releases/1.4.4.txt
@@ -4003,11 +3990,10 @@ docs/releases/1.4.7.txt
docs/releases/1.4.8.txt
docs/releases/1.4.9.txt
docs/releases/1.4.txt
-docs/releases/1.5-alpha-1.txt
-docs/releases/1.5-beta-1.txt
docs/releases/1.5.1.txt
docs/releases/1.5.10.txt
docs/releases/1.5.11.txt
+docs/releases/1.5.12.txt
docs/releases/1.5.2.txt
docs/releases/1.5.3.txt
docs/releases/1.5.4.txt
@@ -4025,8 +4011,10 @@ docs/releases/1.6.5.txt
docs/releases/1.6.6.txt
docs/releases/1.6.7.txt
docs/releases/1.6.8.txt
+docs/releases/1.6.9.txt
docs/releases/1.6.txt
docs/releases/1.7.1.txt
+docs/releases/1.7.2.txt
docs/releases/1.7.txt
docs/releases/index.txt
docs/releases/security.txt
@@ -4199,9 +4187,9 @@ tests/admin_scripts/simple_app/models.py
tests/admin_scripts/simple_app/management/__init__.py
tests/admin_scripts/simple_app/management/commands/__init__.py
tests/admin_scripts/simple_app/management/commands/duplicate.py
-tests/admin_util/__init__.py
-tests/admin_util/models.py
-tests/admin_util/tests.py
+tests/admin_utils/__init__.py
+tests/admin_utils/models.py
+tests/admin_utils/tests.py
tests/admin_validation/__init__.py
tests/admin_validation/models.py
tests/admin_validation/tests.py
@@ -4449,6 +4437,12 @@ tests/fixtures/fixtures/fixture8.json
tests/fixtures/fixtures/fixture9.xml
tests/fixtures/fixtures/initial_data.json
tests/fixtures/fixtures/invalid.json
+tests/fixtures_migration/__init__.py
+tests/fixtures_migration/models.py
+tests/fixtures_migration/tests.py
+tests/fixtures_migration/fixtures/initial_data.json
+tests/fixtures_migration/migrations/0001_initial.py
+tests/fixtures_migration/migrations/__init__.py
tests/fixtures_model_package/__init__.py
tests/fixtures_model_package/tests.py
tests/fixtures_model_package/fixtures/fixture1.json
@@ -4506,7 +4500,7 @@ tests/forms_tests/tests/test_formsets.py
tests/forms_tests/tests/test_input_formats.py
tests/forms_tests/tests/test_media.py
tests/forms_tests/tests/test_regressions.py
-tests/forms_tests/tests/test_util.py
+tests/forms_tests/tests/test_utils.py
tests/forms_tests/tests/test_validators.py
tests/forms_tests/tests/test_widgets.py
tests/forms_tests/tests/tests.py
@@ -4673,6 +4667,7 @@ tests/introspection/tests.py
tests/invalid_models_tests/__init__.py
tests/invalid_models_tests/base.py
tests/invalid_models_tests/test_backend_specific.py
+tests/invalid_models_tests/test_custom_fields.py
tests/invalid_models_tests/test_models.py
tests/invalid_models_tests/test_ordinary_fields.py
tests/invalid_models_tests/test_relative_fields.py
@@ -4750,6 +4745,7 @@ tests/middleware_exceptions/views.py
tests/migrate_signals/__init__.py
tests/migrate_signals/models.py
tests/migrate_signals/tests.py
+tests/migrate_signals/custom_migrations/__init__.py
tests/migration_test_data_persistence/__init__.py
tests/migration_test_data_persistence/models.py
tests/migration_test_data_persistence/tests.py
@@ -4929,6 +4925,10 @@ tests/pagination/tests.py
tests/prefetch_related/__init__.py
tests/prefetch_related/models.py
tests/prefetch_related/tests.py
+tests/project_template/__init__.py
+tests/project_template/test_settings.py
+tests/project_template/urls.py
+tests/project_template/views.py
tests/properties/__init__.py
tests/properties/models.py
tests/properties/tests.py
diff --git a/PKG-INFO b/PKG-INFO
index 34d27a9..83b4829 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: Django
-Version: 1.7.1
+Version: 1.7.2
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
@@ -8,7 +8,7 @@ Author-email: foundation at djangoproject.com
License: BSD
Description: UNKNOWN
Platform: UNKNOWN
-Classifier: Development Status :: 4 - Beta
+Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
diff --git a/django/__init__.py b/django/__init__.py
index 303815c..5df6a56 100644
--- a/django/__init__.py
+++ b/django/__init__.py
@@ -1,4 +1,4 @@
-VERSION = (1, 7, 1, 'final', 0)
+VERSION = (1, 7, 2, 'final', 0)
def get_version(*args, **kwargs):
diff --git a/django/apps/registry.py b/django/apps/registry.py
index 57bdc3e..fe53d96 100644
--- a/django/apps/registry.py
+++ b/django/apps/registry.py
@@ -208,9 +208,17 @@ class Apps(object):
model_name = model._meta.model_name
app_models = self.all_models[app_label]
if model_name in app_models:
- raise RuntimeError(
- "Conflicting '%s' models in application '%s': %s and %s." %
- (model_name, app_label, app_models[model_name], model))
+ if (model.__name__ == app_models[model_name].__name__ and
+ model.__module__ == app_models[model_name].__module__):
+ 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),
+ RuntimeWarning, stacklevel=2)
+ else:
+ raise RuntimeError(
+ "Conflicting '%s' models in application '%s': %s and %s." %
+ (model_name, app_label, app_models[model_name], model))
app_models[model_name] = model
self.clear_cache()
diff --git a/django/conf/locale/ko/LC_MESSAGES/django.mo b/django/conf/locale/ko/LC_MESSAGES/django.mo
index 6a43bd0..68239e5 100644
Binary files a/django/conf/locale/ko/LC_MESSAGES/django.mo and b/django/conf/locale/ko/LC_MESSAGES/django.mo differ
diff --git a/django/conf/locale/ko/LC_MESSAGES/django.po b/django/conf/locale/ko/LC_MESSAGES/django.po
index 3781fc3..9b52248 100644
--- a/django/conf/locale/ko/LC_MESSAGES/django.po
+++ b/django/conf/locale/ko/LC_MESSAGES/django.po
@@ -5,13 +5,14 @@
# Jaehong Kim <mixe at korea.com>, 2011
# Jannis Leidel <jannis at leidel.info>, 2011
# Jeong Seongtae <magno79 at gmail.com>, 2014
+# JuneHyeon Bae <devunt at gmail.com>, 2014
msgid ""
msgstr ""
"Project-Id-Version: django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-08-23 14:10+0200\n"
-"PO-Revision-Date: 2014-08-24 08:52+0000\n"
-"Last-Translator: Jannis Leidel <jannis at leidel.info>\n"
+"PO-Revision-Date: 2014-12-14 04:22+0000\n"
+"Last-Translator: JuneHyeon Bae <devunt at gmail.com>\n"
"Language-Team: Korean (http://www.transifex.com/projects/p/django/language/"
"ko/)\n"
"MIME-Version: 1.0\n"
@@ -1242,41 +1243,41 @@ msgstr ","
#, python-format
msgid "%d year"
msgid_plural "%d years"
-msgstr[0] "%d "
+msgstr[0] "%d년"
#: utils/timesince.py:26
#, python-format
msgid "%d month"
msgid_plural "%d months"
-msgstr[0] "%d 2개월"
+msgstr[0] "%d개월"
#: utils/timesince.py:27
#, python-format
msgid "%d week"
msgid_plural "%d weeks"
-msgstr[0] "%d "
+msgstr[0] "%d주"
#: utils/timesince.py:28
#, python-format
msgid "%d day"
msgid_plural "%d days"
-msgstr[0] "%d "
+msgstr[0] "%d일"
#: utils/timesince.py:29
#, python-format
msgid "%d hour"
msgid_plural "%d hours"
-msgstr[0] "%d "
+msgstr[0] "%d시간"
#: utils/timesince.py:30
#, python-format
msgid "%d minute"
msgid_plural "%d minutes"
-msgstr[0] "%d "
+msgstr[0] "%d분"
#: utils/timesince.py:46
msgid "0 minutes"
-msgstr "0"
+msgstr "0분"
#: views/csrf.py:105
msgid "Forbidden"
diff --git a/django/conf/locale/uk/formats.py b/django/conf/locale/uk/formats.py
index e2a3363..821585f 100644
--- a/django/conf/locale/uk/formats.py
+++ b/django/conf/locale/uk/formats.py
@@ -13,7 +13,7 @@ YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'j M Y'
# SHORT_DATETIME_FORMAT =
-# FIRST_DAY_OF_WEEK =
+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
diff --git a/django/contrib/admin/actions.py b/django/contrib/admin/actions.py
index 158c436..e79b86a 100644
--- a/django/contrib/admin/actions.py
+++ b/django/contrib/admin/actions.py
@@ -63,16 +63,17 @@ def delete_selected(modeladmin, request, queryset):
else:
title = _("Are you sure?")
- context = {
- "title": title,
- "objects_name": objects_name,
- "deletable_objects": [deletable_objects],
- 'queryset': queryset,
- "perms_lacking": perms_needed,
- "protected": protected,
- "opts": opts,
- 'action_checkbox_name': helpers.ACTION_CHECKBOX_NAME,
- }
+ context = dict(
+ modeladmin.admin_site.each_context(),
+ title=title,
+ objects_name=objects_name,
+ deletable_objects=[deletable_objects],
+ queryset=queryset,
+ perms_lacking=perms_needed,
+ protected=protected,
+ opts=opts,
+ action_checkbox_name=helpers.ACTION_CHECKBOX_NAME,
+ )
# Display the confirmation page
return TemplateResponse(request, modeladmin.delete_selected_confirmation_template or [
diff --git a/django/contrib/admin/checks.py b/django/contrib/admin/checks.py
index 3350625..334c338 100644
--- a/django/contrib/admin/checks.py
+++ b/django/contrib/admin/checks.py
@@ -11,12 +11,9 @@ from django.forms.models import BaseModelForm, _get_foreign_key, BaseModelFormSe
def check_admin_app(**kwargs):
- from django.contrib.admin.sites import site
+ from django.contrib.admin.sites import system_check_errors
- return list(chain.from_iterable(
- model_admin.check(model, **kwargs)
- for model, model_admin in site._registry.items()
- ))
+ return system_check_errors
class BaseModelAdminChecks(object):
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index cef9021..0459e83 100644
--- a/django/contrib/admin/options.py
+++ b/django/contrib/admin/options.py
@@ -139,7 +139,7 @@ class BaseModelAdmin(six.with_metaclass(RenameBaseModelAdminMethods)):
if cls.validator_class:
warnings.warn(
'ModelAdmin.validator_class is deprecated. '
- 'ModeAdmin validators must be converted to use '
+ 'ModelAdmin validators must be converted to use '
'the system check framework.',
RemovedInDjango19Warning)
validator = cls.validator_class()
@@ -450,9 +450,9 @@ class BaseModelAdmin(six.with_metaclass(RenameBaseModelAdminMethods)):
except FieldDoesNotExist:
return False
- # Check whether this model is the origin of a M2M relationship
- # in which case to_field has to be the pk on this model.
- if opts.many_to_many and field.primary_key:
+ # Always allow referencing the primary key since it's already possible
+ # to get this information from the change view URL.
+ if field.primary_key:
return True
# Make sure at least one of the models registered for this site
@@ -463,8 +463,7 @@ class BaseModelAdmin(six.with_metaclass(RenameBaseModelAdminMethods)):
for inline in admin.inlines:
registered_models.add(inline.model)
- for related_object in (opts.get_all_related_objects(include_hidden=True) +
- opts.get_all_related_many_to_many_objects()):
+ for related_object in opts.get_all_related_objects(include_hidden=True):
related_model = related_object.model
if (any(issubclass(model, related_model) for model in registered_models) and
related_object.field.rel.get_related_field() == field):
@@ -1400,7 +1399,7 @@ class ModelAdmin(BaseModelAdmin):
else:
form_validated = False
new_object = form.instance
- formsets, inline_instances = self._create_formsets(request, new_object)
+ formsets, inline_instances = self._create_formsets(request, new_object, change=not add)
if all_valid(formsets) and form_validated:
self.save_model(request, new_object, form, not add)
self.save_related(request, form, formsets, not add)
@@ -1415,10 +1414,10 @@ class ModelAdmin(BaseModelAdmin):
if add:
initial = self.get_changeform_initial_data(request)
form = ModelForm(initial=initial)
- formsets, inline_instances = self._create_formsets(request, self.model())
+ formsets, inline_instances = self._create_formsets(request, self.model(), change=False)
else:
form = ModelForm(instance=obj)
- formsets, inline_instances = self._create_formsets(request, obj)
+ formsets, inline_instances = self._create_formsets(request, obj, change=True)
adminForm = helpers.AdminForm(
form,
@@ -1703,13 +1702,13 @@ class ModelAdmin(BaseModelAdmin):
"admin/object_history.html"
], context, current_app=self.admin_site.name)
- def _create_formsets(self, request, obj):
+ def _create_formsets(self, request, obj, change):
"Helper function to generate formsets for add/change_view."
formsets = []
inline_instances = []
prefixes = {}
get_formsets_args = [request]
- if obj.pk:
+ if change:
get_formsets_args.append(obj)
for FormSet, inline in self.get_formsets_with_inlines(*get_formsets_args):
prefix = FormSet.get_default_prefix()
@@ -1830,6 +1829,8 @@ class InlineModelAdmin(BaseModelAdmin):
if self.cleaned_data.get(DELETION_FIELD_NAME, False):
using = router.db_for_write(self._meta.model)
collector = NestedObjects(using=using)
+ if self.instance.pk is None:
+ return
collector.collect([self.instance])
if collector.protected:
objs = []
diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
index efac3c7..b6df3fa 100644
--- a/django/contrib/admin/sites.py
+++ b/django/contrib/admin/sites.py
@@ -14,6 +14,8 @@ from django.utils.translation import ugettext_lazy, ugettext as _
from django.views.decorators.cache import never_cache
from django.conf import settings
+system_check_errors = []
+
class AlreadyRegistered(Exception):
pass
@@ -96,7 +98,7 @@ class AdminSite(object):
admin_class = type("%sAdmin" % model.__name__, (admin_class,), options)
if admin_class is not ModelAdmin and settings.DEBUG:
- admin_class.check(model)
+ system_check_errors.extend(admin_class.check(model))
# Instantiate the admin class to save in the registry
self._registry[model] = admin_class(model, self)
diff --git a/django/contrib/admin/static/admin/js/SelectFilter2.js b/django/contrib/admin/static/admin/js/SelectFilter2.js
index d9f6aad..4da5b90 100644
--- a/django/contrib/admin/static/admin/js/SelectFilter2.js
+++ b/django/contrib/admin/static/admin/js/SelectFilter2.js
@@ -15,7 +15,7 @@ function findForm(node) {
window.SelectFilter = {
init: function(field_id, field_name, is_stacked, admin_static_prefix) {
if (field_id.match(/__prefix__/)){
- // Don't intialize on empty forms.
+ // Don't initialize on empty forms.
return;
}
var from_box = document.getElementById(field_id);
diff --git a/django/contrib/admindocs/views.py b/django/contrib/admindocs/views.py
index 06f8844..1c09390 100644
--- a/django/contrib/admindocs/views.py
+++ b/django/contrib/admindocs/views.py
@@ -309,6 +309,10 @@ def load_all_installed_template_libraries():
# Load/register all template tag libraries from installed apps.
for module_name in template.get_templatetags_modules():
mod = import_module(module_name)
+ if not hasattr(mod, '__file__'):
+ # e.g. packages installed as eggs
+ continue
+
try:
libraries = [
os.path.splitext(p)[0]
@@ -316,12 +320,13 @@ def load_all_installed_template_libraries():
if p.endswith('.py') and p[0].isalpha()
]
except OSError:
- libraries = []
- for library_name in libraries:
- try:
- template.get_library(library_name)
- except template.InvalidTemplateLibrary:
- pass
+ continue
+ else:
+ for library_name in libraries:
+ try:
+ template.get_library(library_name)
+ except template.InvalidTemplateLibrary:
+ pass
def get_return_data_type(func_name):
diff --git a/django/contrib/auth/__init__.py b/django/contrib/auth/__init__.py
index a316f68..b7c1349 100644
--- a/django/contrib/auth/__init__.py
+++ b/django/contrib/auth/__init__.py
@@ -4,9 +4,10 @@ import re
from django.apps import apps as django_apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
+from django.middleware.csrf import rotate_token
+from django.utils.crypto import constant_time_compare
from django.utils.module_loading import import_string
from django.utils.translation import LANGUAGE_SESSION_KEY
-from django.middleware.csrf import rotate_token
from .signals import user_logged_in, user_logged_out, user_login_failed
@@ -156,6 +157,18 @@ def get_user(request):
if backend_path in settings.AUTHENTICATION_BACKENDS:
backend = load_backend(backend_path)
user = backend.get_user(user_id)
+ # Verify the session
+ if ('django.contrib.auth.middleware.SessionAuthenticationMiddleware'
+ in settings.MIDDLEWARE_CLASSES and hasattr(user, 'get_session_auth_hash')):
+ session_hash = request.session.get(HASH_SESSION_KEY)
+ session_hash_verified = session_hash and constant_time_compare(
+ session_hash,
+ user.get_session_auth_hash()
+ )
+ if not session_hash_verified:
+ request.session.flush()
+ user = None
+
return user or AnonymousUser()
diff --git a/django/contrib/auth/middleware.py b/django/contrib/auth/middleware.py
index b34da60..02c7b26 100644
--- a/django/contrib/auth/middleware.py
+++ b/django/contrib/auth/middleware.py
@@ -2,7 +2,6 @@ from django.contrib import auth
from django.contrib.auth import load_backend
from django.contrib.auth.backends import RemoteUserBackend
from django.core.exceptions import ImproperlyConfigured
-from django.utils.crypto import constant_time_compare
from django.utils.functional import SimpleLazyObject
@@ -25,20 +24,15 @@ class AuthenticationMiddleware(object):
class SessionAuthenticationMiddleware(object):
"""
- Middleware for invalidating a user's sessions that don't correspond to the
- user's current session authentication hash (generated based on the user's
- password for AbstractUser).
+ Formerly, a middleware for invalidating a user's sessions that don't
+ correspond to the user's current session authentication hash. However, it
+ caused the "Vary: Cookie" header on all responses.
+
+ Now a backwards compatibility shim that enables session verification in
+ auth.get_user() if this middleware is in MIDDLEWARE_CLASSES.
"""
def process_request(self, request):
- user = request.user
- if user and hasattr(user, 'get_session_auth_hash'):
- session_hash = request.session.get(auth.HASH_SESSION_KEY)
- session_hash_verified = session_hash and constant_time_compare(
- session_hash,
- user.get_session_auth_hash()
- )
- if not session_hash_verified:
- auth.logout(request)
+ pass
class RemoteUserMiddleware(object):
diff --git a/django/contrib/auth/tests/test_forms.py b/django/contrib/auth/tests/test_forms.py
index 2d02f3a..d66c383 100644
--- a/django/contrib/auth/tests/test_forms.py
+++ b/django/contrib/auth/tests/test_forms.py
@@ -386,7 +386,7 @@ class PasswordResetFormTest(TestCase):
self.assertFalse(form.is_valid())
self.assertEqual(form['email'].errors, [_('Enter a valid email address.')])
- def test_nonexistant_email(self):
+ def test_nonexistent_email(self):
"""
Test nonexistent email address. This should not fail because it would
expose information about registered users.
diff --git a/django/contrib/auth/tests/test_middleware.py b/django/contrib/auth/tests/test_middleware.py
index 2bdc77a..f81f1d7 100644
--- a/django/contrib/auth/tests/test_middleware.py
+++ b/django/contrib/auth/tests/test_middleware.py
@@ -1,4 +1,4 @@
-from django.contrib.auth.middleware import SessionAuthenticationMiddleware
+from django.contrib.auth.middleware import AuthenticationMiddleware
from django.contrib.auth.models import User
from django.http import HttpRequest
from django.test import TestCase
@@ -11,25 +11,40 @@ class TestSessionAuthenticationMiddleware(TestCase):
'test at example.com',
self.user_password)
- def test_changed_password_invalidates_session(self):
- """
- Tests that changing a user's password invalidates the session.
- """
- verification_middleware = SessionAuthenticationMiddleware()
+ self.middleware = AuthenticationMiddleware()
self.assertTrue(self.client.login(
username=self.user.username,
password=self.user_password,
))
- request = HttpRequest()
- request.session = self.client.session
- request.user = self.user
- verification_middleware.process_request(request)
- self.assertIsNotNone(request.user)
- self.assertFalse(request.user.is_anonymous())
+ self.request = HttpRequest()
+ self.request.session = self.client.session
+
+ def test_changed_password_doesnt_invalidate_session(self):
+ """
+ Changing a user's password shouldn't invalidate the session if session
+ verification isn't activated.
+ """
+ session_key = self.request.session.session_key
+ self.middleware.process_request(self.request)
+ self.assertIsNotNone(self.request.user)
+ self.assertFalse(self.request.user.is_anonymous())
+
+ # After password change, user should remain logged in.
+ self.user.set_password('new_password')
+ self.user.save()
+ self.middleware.process_request(self.request)
+ self.assertIsNotNone(self.request.user)
+ self.assertFalse(self.request.user.is_anonymous())
+ self.assertEqual(session_key, self.request.session.session_key)
- # After password change, user should be anonymous
- request.user.set_password('new_password')
- request.user.save()
- verification_middleware.process_request(request)
- self.assertIsNotNone(request.user)
- self.assertTrue(request.user.is_anonymous())
+ def test_changed_password_invalidates_session_with_middleware(self):
+ session_key = self.request.session.session_key
+ with self.modify_settings(MIDDLEWARE_CLASSES={'append': ['django.contrib.auth.middleware.SessionAuthenticationMiddleware']}):
+ # After password change, user should be anonymous
+ self.user.set_password('new_password')
+ self.user.save()
+ self.middleware.process_request(self.request)
+ self.assertIsNotNone(self.request.user)
+ self.assertTrue(self.request.user.is_anonymous())
+ # session should be flushed
+ self.assertNotEqual(session_key, self.request.session.session_key)
diff --git a/django/contrib/gis/db/backends/mysql/schema.py b/django/contrib/gis/db/backends/mysql/schema.py
index 3979182..4d70868 100644
--- a/django/contrib/gis/db/backends/mysql/schema.py
+++ b/django/contrib/gis/db/backends/mysql/schema.py
@@ -15,6 +15,13 @@ class MySQLGISSchemaEditor(DatabaseSchemaEditor):
super(MySQLGISSchemaEditor, self).__init__(*args, **kwargs)
self.geometry_sql = []
+ def skip_default(self, field):
+ return (
+ super(MySQLGISSchemaEditor, self).skip_default(field) or
+ # Geometry fields are stored as BLOB/TEXT and can't have defaults.
+ isinstance(field, GeometryField)
+ )
+
def column_sql(self, model, field, include_default=False):
column_sql = super(MySQLGISSchemaEditor, self).column_sql(model, field, include_default)
# MySQL doesn't support spatial indexes on NULL columns
diff --git a/django/contrib/gis/db/backends/spatialite/creation.py b/django/contrib/gis/db/backends/spatialite/creation.py
index a3d4de9..4a6a122 100644
--- a/django/contrib/gis/db/backends/spatialite/creation.py
+++ b/django/contrib/gis/db/backends/spatialite/creation.py
@@ -95,7 +95,8 @@ class SpatiaLiteCreation(DatabaseCreation):
# InitSpatialMetaData() transparently creates the spatial metadata
# tables
cur = self.connection._cursor()
- cur.execute("SELECT InitSpatialMetaData()")
+ arg = "1" if self.connection.ops.spatial_version >= (4, 1, 0) else ""
+ cur.execute("SELECT InitSpatialMetaData(%s)" % arg)
else:
# Spatialite < 2.4 -- Load the initial SQL
diff --git a/django/contrib/gis/db/models/fields.py b/django/contrib/gis/db/models/fields.py
index b71bba7..6d637fd 100644
--- a/django/contrib/gis/db/models/fields.py
+++ b/django/contrib/gis/db/models/fields.py
@@ -274,7 +274,7 @@ class GeometryField(Field):
def get_db_prep_save(self, value, connection):
"Prepares the value for saving in the database."
- if value is None:
+ if not value:
return None
else:
return connection.ops.Adapter(self.get_prep_value(value))
diff --git a/django/contrib/gis/db/models/proxy.py b/django/contrib/gis/db/models/proxy.py
index 91ded31..a866910 100644
--- a/django/contrib/gis/db/models/proxy.py
+++ b/django/contrib/gis/db/models/proxy.py
@@ -57,7 +57,7 @@ class GeometryProxy(object):
# Assigning the SRID to the geometry.
if value.srid is None:
value.srid = self._field.srid
- elif value is None or isinstance(value, six.string_types + (memoryview,)):
+ elif value is None or isinstance(value, six.string_types + (bytes, memoryview)):
# Set with None, WKT, HEX, or WKB
pass
else:
diff --git a/django/contrib/gis/db/models/sql/query.py b/django/contrib/gis/db/models/sql/query.py
index f3fa1f6..ac6e25c 100644
--- a/django/contrib/gis/db/models/sql/query.py
+++ b/django/contrib/gis/db/models/sql/query.py
@@ -14,7 +14,7 @@ class GeoQuery(sql.Query):
"""
A single spatial SQL query.
"""
- # Overridding the valid query terms.
+ # Overriding the valid query terms.
query_terms = ALL_TERMS
aggregates_module = gis_aggregates
diff --git a/django/contrib/gis/gdal/srs.py b/django/contrib/gis/gdal/srs.py
index 65989f5..bbca949 100644
--- a/django/contrib/gis/gdal/srs.py
+++ b/django/contrib/gis/gdal/srs.py
@@ -1,5 +1,5 @@
"""
- The Spatial Reference class, represensents OGR Spatial Reference objects.
+ The Spatial Reference class, represents OGR Spatial Reference objects.
Example:
>>> from django.contrib.gis.gdal import SpatialReference
diff --git a/django/contrib/gis/tests/geoapp/tests.py b/django/contrib/gis/tests/geoapp/tests.py
index 0d43f63..95a11cc 100644
--- a/django/contrib/gis/tests/geoapp/tests.py
+++ b/django/contrib/gis/tests/geoapp/tests.py
@@ -437,8 +437,11 @@ class GeoQuerySetTest(TestCase):
self.assertEqual(c.mpoly.difference(geom), c.difference)
if not spatialite:
self.assertEqual(c.mpoly.intersection(geom), c.intersection)
- self.assertEqual(c.mpoly.sym_difference(geom), c.sym_difference)
- self.assertEqual(c.mpoly.union(geom), c.union)
+ # Ordering might differ in collections
... 16437 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