Permalink
Browse files

Merge remote-tracking branch 'core/master' into schema-alteration

Conflicts:
	django/db/backends/mysql/base.py
	django/db/backends/postgresql_psycopg2/base.py
  • Loading branch information...
2 parents dbf8b93 + d21f3d9 commit 9313dea7006ab77d54735fdd5825a812684e7144 @andrewgodwin andrewgodwin committed Sep 17, 2012
Showing with 2,045 additions and 1,256 deletions.
  1. +3 −1 AUTHORS
  2. +13 −5 django/conf/__init__.py
  3. +6 −3 django/contrib/admin/filters.py
  4. +4 −1 django/contrib/admin/options.py
  5. +254 −118 django/contrib/admin/static/admin/js/inlines.js
  6. +9 −5 django/contrib/admin/static/admin/js/inlines.min.js
  7. +6 −58 django/contrib/admin/templates/admin/edit_inline/stacked.html
  8. +7 −58 django/contrib/admin/templates/admin/edit_inline/tabular.html
  9. +1 −1 django/contrib/admin/templatetags/admin_list.py
  10. +1 −1 django/contrib/admin/util.py
  11. +7 −4 django/contrib/auth/decorators.py
  12. +14 −14 django/contrib/auth/forms.py
  13. +7 −1 django/contrib/auth/hashers.py
  14. +1 −1 django/contrib/auth/models.py
  15. +1 −1 django/contrib/auth/tests/decorators.py
  16. +12 −6 django/contrib/auth/tests/forms.py
  17. +4 −0 django/contrib/auth/tests/hashers.py
  18. +3 −2 django/contrib/auth/tests/views.py
  19. +9 −9 django/contrib/auth/views.py
  20. +0 −2 django/contrib/gis/db/backends/base.py
  21. +0 −14 django/contrib/gis/db/backends/util.py
  22. +1 −1 django/contrib/gis/db/models/sql/where.py
  23. +5 −1 django/contrib/gis/gdal/tests/test_ds.py
  24. +4 −2 django/contrib/gis/gdal/tests/test_geom.py
  25. +1 −1 django/contrib/gis/geos/libgeos.py
  26. +6 −3 django/contrib/gis/geos/mutable_list.py
  27. +2 −1 django/contrib/gis/geos/tests/__init__.py
  28. +4 −2 django/contrib/gis/geos/tests/test_geos.py
  29. +8 −8 django/contrib/gis/geos/tests/test_mutable_list.py
  30. +2 −1 django/contrib/gis/tests/geoapp/tests.py
  31. +12 −20 django/contrib/gis/tests/test_spatialrefsys.py
  32. +6 −0 django/contrib/markup/templatetags/markup.py
  33. +10 −1 django/contrib/markup/tests.py
  34. +4 −4 django/contrib/messages/storage/cookie.py
  35. +5 −5 django/contrib/messages/tests/base.py
  36. +7 −7 django/contrib/sessions/tests.py
  37. +11 −12 django/core/handlers/wsgi.py
  38. +2 −1 django/core/management/__init__.py
  39. +3 −0 django/core/management/commands/runserver.py
  40. +5 −2 django/db/backends/__init__.py
  41. +2 −1 django/db/backends/mysql/base.py
  42. +0 −10 django/db/backends/mysql/introspection.py
  43. +2 −1 django/db/backends/postgresql_psycopg2/base.py
  44. +7 −0 django/db/models/constants.py
  45. +1 −2 django/db/models/query.py
  46. +7 −2 django/db/models/sql/compiler.py
  47. +7 −4 django/db/models/sql/constants.py
  48. +1 −1 django/db/models/sql/expressions.py
  49. +3 −2 django/db/models/sql/query.py
  50. +1 −0 django/db/models/sql/subqueries.py
  51. +1 −1 django/forms/fields.py
  52. +11 −7 django/forms/widgets.py
  53. +35 −21 django/http/__init__.py
  54. +1 −1 django/middleware/csrf.py
  55. +32 −17 django/shortcuts/__init__.py
  56. +2 −4 django/template/defaulttags.py
  57. +7 −0 django/test/signals.py
  58. +10 −7 django/utils/_os.py
  59. +1 −2 django/utils/html_parser.py
  60. +3 −0 django/views/generic/dates.py
  61. +2 −3 docs/README
  62. +0 −11 docs/contents.txt
  63. +2 −3 docs/faq/admin.txt
  64. +17 −23 docs/faq/install.txt
  65. +1 −1 docs/faq/models.txt
  66. +4 −4 docs/howto/custom-model-fields.txt
  67. +1 −1 docs/index.txt
  68. +28 −10 docs/internals/committers.txt
  69. +3 −0 docs/internals/deprecation.txt
  70. +3 −5 docs/intro/install.txt
  71. +4 −4 docs/intro/overview.txt
  72. +3 −2 docs/intro/tutorial03.txt
  73. +2 −2 docs/intro/tutorial04.txt
  74. +1 −2 docs/intro/whatsnext.txt
  75. BIN docs/obsolete/_images/formrow.png
  76. BIN docs/obsolete/_images/module.png
  77. BIN docs/obsolete/_images/objecttools_01.png
  78. BIN docs/obsolete/_images/objecttools_02.png
  79. +0 −186 docs/obsolete/admin-css.txt
  80. +0 −12 docs/obsolete/index.txt
  81. +35 −30 docs/ref/class-based-views/base.txt
  82. +79 −49 docs/ref/class-based-views/generic-date-based.txt
  83. +56 −1 docs/ref/class-based-views/generic-display.txt
  84. +5 −4 docs/ref/class-based-views/index.txt
  85. +114 −59 docs/ref/class-based-views/mixins-date-based.txt
  86. +2 −1 docs/ref/class-based-views/mixins-multiple-object.txt
  87. +17 −8 docs/ref/class-based-views/mixins-simple.txt
  88. +4 −4 docs/ref/contrib/comments/moderation.txt
  89. +8 −0 docs/ref/contrib/contenttypes.txt
  90. +61 −1 docs/ref/contrib/formtools/form-wizard.txt
  91. +6 −6 docs/ref/contrib/gis/install.txt
  92. +2 −2 docs/ref/contrib/gis/tutorial.txt
  93. +3 −0 docs/ref/contrib/markup.txt
  94. +47 −49 docs/ref/contrib/messages.txt
  95. +44 −17 docs/ref/forms/fields.txt
  96. +178 −58 docs/ref/forms/widgets.txt
  97. +10 −2 docs/ref/models/fields.txt
  98. +1 −1 docs/ref/models/instances.txt
  99. +51 −6 docs/ref/models/querysets.txt
  100. +13 −23 docs/ref/settings.txt
  101. +14 −0 docs/releases/1.5.txt
  102. +1 −0 docs/releases/index.txt
  103. +37 −0 docs/topics/auth.txt
  104. +44 −0 docs/topics/class-based-views/index.txt
  105. +4 −4 docs/topics/db/examples/many_to_one.txt
  106. +92 −36 docs/topics/db/multi-db.txt
  107. +12 −11 docs/topics/db/queries.txt
  108. +12 −12 docs/topics/forms/media.txt
  109. +3 −3 docs/topics/forms/modelforms.txt
  110. +52 −50 docs/topics/http/urls.txt
  111. +5 −0 docs/topics/i18n/translation.txt
  112. +5 −8 docs/topics/install.txt
  113. +6 −6 docs/topics/logging.txt
  114. +9 −2 docs/topics/python3.txt
  115. +59 −2 tests/regressiontests/admin_inlines/tests.py
  116. +19 −19 tests/regressiontests/admin_scripts/tests.py
  117. +15 −3 tests/regressiontests/admin_views/admin.py
  118. +1 −0 tests/regressiontests/admin_views/customadmin.py
  119. +7 −0 tests/regressiontests/admin_views/models.py
  120. +19 −1 tests/regressiontests/admin_views/tests.py
  121. +13 −0 tests/regressiontests/backends/tests.py
  122. +1 −1 tests/regressiontests/comment_tests/tests/__init__.py
  123. +9 −0 tests/regressiontests/comment_tests/urls_default.py
  124. +3 −0 tests/regressiontests/defer_regress/models.py
  125. +15 −1 tests/regressiontests/defer_regress/tests.py
  126. +9 −9 tests/regressiontests/forms/tests/widgets.py
  127. +42 −22 tests/regressiontests/httpwrappers/tests.py
  128. +13 −0 tests/regressiontests/model_permalink/models.py
  129. +9 −0 tests/regressiontests/model_permalink/tests.py
  130. 0 tests/regressiontests/resolve_url/__init__.py
  131. +12 −0 tests/regressiontests/resolve_url/models.py
  132. +68 −0 tests/regressiontests/resolve_url/tests.py
  133. +26 −0 tests/regressiontests/utils/os_utils.py
  134. +1 −0 tests/regressiontests/utils/tests.py
  135. +6 −15 tests/regressiontests/views/tests/debug.py
  136. +1 −1 tests/runtests.py
View
@@ -31,6 +31,8 @@ The PRIMARY AUTHORS are (and/or have been):
* Claude Paroz
* Anssi Kääriäinen
* Florian Apolloner
+ * Jeremy Dunck
+ * Bryan Veloso
More information on the main contributors to Django can be found in
docs/internals/committers.txt.
@@ -167,7 +169,6 @@ answer newbie questions, and generally made Django that much better:
dready <wil@mojipage.com>
Maximillian Dornseif <md@hudora.de>
Daniel Duan <DaNmarner@gmail.com>
- Jeremy Dunck <http://dunck.us/>
Andrew Durdin <adurdin@gmail.com>
dusk@woofle.net
Andy Dustman <farcepest@gmail.com>
@@ -506,6 +507,7 @@ answer newbie questions, and generally made Django that much better:
Johan C. Stöver <johan@nilling.nl>
Nowell Strite <http://nowell.strite.org/>
Thomas Stromberg <tstromberg@google.com>
+ Travis Swicegood <travis@domain51.com>
Pascal Varet
SuperJared
Radek Švarz <http://www.svarz.cz/translate/>
@@ -7,7 +7,6 @@
"""
import os
-import re
import time # Needed for Windows
import warnings
@@ -26,7 +25,7 @@ class LazySettings(LazyObject):
The user can manually configure settings prior to using them. Otherwise,
Django uses the settings module pointed to by DJANGO_SETTINGS_MODULE.
"""
- def _setup(self):
+ def _setup(self, name):
"""
Load the settings module pointed to by the environment variable. This
is used the first time we need any settings at all, if the user has not
@@ -37,12 +36,21 @@ def _setup(self):
if not settings_module: # If it's set but is an empty string.
raise KeyError
except KeyError:
- # NOTE: This is arguably an EnvironmentError, but that causes
- # problems with Python's interactive help.
- raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)
+ raise ImproperlyConfigured(
+ "Requested setting %s, but settings are not configured. "
+ "You must either define the environment variable %s "
+ "or call settings.configure() before accessing settings."
+ % (name, ENVIRONMENT_VARIABLE))
self._wrapped = Settings(settings_module)
+
+ def __getattr__(self, name):
+ if self._wrapped is empty:
+ self._setup(name)
+ return getattr(self._wrapped, name)
+
+
def configure(self, default_settings=global_settings, **options):
"""
Called to manually configure the settings. The 'default_settings'
@@ -8,13 +8,13 @@
import datetime
from django.db import models
-from django.core.exceptions import ImproperlyConfigured
+from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.utils.encoding import smart_text
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
-
from django.contrib.admin.util import (get_model_from_relation,
reverse_field_path, get_limit_choices_to_from_path, prepare_lookup_value)
+from django.contrib.admin.options import IncorrectLookupParameters
class ListFilter(object):
title = None # Human-readable title to appear in the right sidebar.
@@ -129,7 +129,10 @@ def has_output(self):
return True
def queryset(self, request, queryset):
- return queryset.filter(**self.used_parameters)
+ try:
+ return queryset.filter(**self.used_parameters)
+ except ValidationError as e:
+ raise IncorrectLookupParameters(e)
@classmethod
def register(cls, test, list_filter_class, take_priority=False):
@@ -14,9 +14,10 @@
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse
from django.db import models, transaction, router
+from django.db.models.constants import LOOKUP_SEP
from django.db.models.related import RelatedObject
from django.db.models.fields import BLANK_CHOICE_DASH, FieldDoesNotExist
-from django.db.models.sql.constants import LOOKUP_SEP, QUERY_TERMS
+from django.db.models.sql.constants import QUERY_TERMS
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.template.response import SimpleTemplateResponse, TemplateResponse
@@ -1456,8 +1457,10 @@ def has_delete_permission(self, request, obj=None):
return request.user.has_perm(
self.opts.app_label + '.' + self.opts.get_delete_permission())
+
class StackedInline(InlineModelAdmin):
template = 'admin/edit_inline/stacked.html'
+
class TabularInline(InlineModelAdmin):
template = 'admin/edit_inline/tabular.html'
Oops, something went wrong.

0 comments on commit 9313dea

Please sign in to comment.