Permalink
Browse files

Merge branch 'master' into schema-alteration

  • Loading branch information...
2 parents c4b2a32 + 7275576 commit 184cf9ab798d5b25d855649ddb2ca580949778df @andrewgodwin andrewgodwin committed Aug 10, 2012
Showing with 2,523 additions and 1,747 deletions.
  1. +1 −1 django/conf/__init__.py
  2. +1 −1 django/conf/locale/fi/formats.py
  3. +8 −7 django/conf/locale/gl/formats.py
  4. +2 −2 django/conf/urls/i18n.py
  5. +4 −4 django/contrib/admin/actions.py
  6. +4 −4 django/contrib/admin/filters.py
  7. +7 −7 django/contrib/admin/helpers.py
  8. +3 −3 django/contrib/admin/models.py
  9. +32 −32 django/contrib/admin/options.py
  10. +4 −3 django/contrib/admin/sites.py
  11. +8 −7 django/contrib/admin/templatetags/admin_list.py
  12. +9 −9 django/contrib/admin/util.py
  13. +3 −3 django/contrib/admin/views/main.py
  14. +4 −4 django/contrib/admin/widgets.py
  15. +2 −2 django/contrib/admindocs/utils.py
  16. +3 −2 django/contrib/admindocs/views.py
  17. +2 −1 django/contrib/auth/admin.py
  18. +2 −1 django/contrib/auth/context_processors.py
  19. +3 −3 django/contrib/auth/forms.py
  20. +6 −5 django/contrib/auth/hashers.py
  21. +3 −2 django/contrib/auth/management/__init__.py
  22. +3 −2 django/contrib/auth/management/commands/createsuperuser.py
  23. +17 −15 django/contrib/auth/tests/forms.py
  24. +2 −2 django/contrib/auth/tests/views.py
  25. +2 −2 django/contrib/comments/forms.py
  26. +2 −2 django/contrib/comments/managers.py
  27. +2 −2 django/contrib/comments/templatetags/comments.py
  28. +2 −2 django/contrib/contenttypes/generic.py
  29. +7 −5 django/contrib/contenttypes/management.py
  30. +5 −5 django/contrib/contenttypes/models.py
  31. +11 −13 django/contrib/databrowse/datastructures.py
  32. +3 −3 django/contrib/databrowse/plugins/calendars.py
  33. +3 −3 django/contrib/databrowse/plugins/fieldchoices.py
  34. +1 −1 django/contrib/formtools/tests/__init__.py
  35. +6 −5 django/contrib/formtools/wizard/storage/base.py
  36. +4 −4 django/contrib/formtools/wizard/views.py
  37. +3 −1 django/contrib/gis/db/backends/mysql/operations.py
  38. +1 −1 django/contrib/gis/db/backends/oracle/operations.py
  39. +11 −30 django/contrib/gis/db/backends/postgis/operations.py
  40. +3 −3 django/contrib/gis/db/backends/spatialite/creation.py
  41. +1 −1 django/contrib/gis/db/backends/spatialite/operations.py
  42. +3 −2 django/contrib/gis/db/models/query.py
  43. +3 −2 django/contrib/gis/db/models/sql/compiler.py
  44. +2 −3 django/contrib/gis/gdal/geometries.py
  45. +2 −1 django/contrib/gis/geometry/test_data.py
  46. +9 −5 django/contrib/gis/measure.py
  47. +4 −3 django/contrib/gis/sitemaps/views.py
  48. +7 −7 django/contrib/gis/tests/geoapp/test_regress.py
  49. +404 −397 django/contrib/gis/tests/geoapp/tests.py
  50. +2 −2 django/contrib/humanize/templatetags/humanize.py
  51. +2 −2 django/contrib/localflavor/au/forms.py
  52. +6 −6 django/contrib/localflavor/br/forms.py
  53. +2 −2 django/contrib/localflavor/ca/forms.py
  54. +2 −2 django/contrib/localflavor/ch/forms.py
  55. +2 −2 django/contrib/localflavor/cl/forms.py
  56. +2 −2 django/contrib/localflavor/fr/forms.py
  57. +2 −2 django/contrib/localflavor/hk/forms.py
  58. +3 −3 django/contrib/localflavor/hr/forms.py
  59. +5 −5 django/contrib/localflavor/id/forms.py
  60. +3 −3 django/contrib/localflavor/in_/forms.py
  61. +2 −2 django/contrib/localflavor/is_/forms.py
  62. +2 −2 django/contrib/localflavor/it/forms.py
  63. +3 −3 django/contrib/localflavor/it/util.py
  64. +2 −2 django/contrib/localflavor/nl/forms.py
  65. +3 −3 django/contrib/localflavor/pt/forms.py
  66. +1 −1 django/contrib/localflavor/si/forms.py
  67. +2 −2 django/contrib/localflavor/tr/forms.py
  68. +2 −2 django/contrib/localflavor/us/forms.py
  69. +10 −10 django/contrib/markup/templatetags/markup.py
  70. +7 −7 django/contrib/messages/storage/base.py
  71. +2 −1 django/contrib/messages/storage/cookie.py
  72. +2 −2 django/contrib/sessions/backends/db.py
  73. +10 −9 django/contrib/sessions/tests.py
  74. +2 −1 django/contrib/sitemaps/views.py
  75. +2 −1 django/contrib/staticfiles/finders.py
  76. +5 −4 django/contrib/staticfiles/management/commands/collectstatic.py
  77. +3 −3 django/contrib/staticfiles/management/commands/findstatic.py
  78. +5 −5 django/contrib/staticfiles/storage.py
  79. +6 −6 django/contrib/syndication/views.py
  80. +3 −3 django/core/cache/backends/base.py
  81. +2 −2 django/core/context_processors.py
  82. +3 −3 django/core/exceptions.py
  83. +7 −5 django/core/files/base.py
  84. +6 −1 django/core/files/images.py
  85. +2 −2 django/core/files/storage.py
  86. +2 −2 django/core/files/uploadedfile.py
  87. +4 −4 django/core/handlers/base.py
  88. +4 −4 django/core/handlers/wsgi.py
  89. +19 −19 django/core/mail/message.py
  90. +3 −2 django/core/management/__init__.py
  91. +2 −2 django/core/management/base.py
  92. +3 −1 django/core/management/commands/compilemessages.py
  93. +2 −2 django/core/management/commands/createcachetable.py
  94. +1 −3 django/core/management/commands/diffsettings.py
  95. +2 −1 django/core/management/commands/flush.py
  96. +2 −2 django/core/management/commands/loaddata.py
  97. +3 −2 django/core/serializers/__init__.py
  98. +4 −2 django/core/serializers/base.py
  99. +1 −1 django/core/serializers/json.py
  100. +11 −10 django/core/serializers/python.py
  101. +1 −1 django/core/serializers/pyyaml.py
  102. +12 −10 django/core/serializers/xml_serializer.py
  103. +6 −6 django/core/signing.py
  104. +7 −7 django/core/urlresolvers.py
  105. +4 −4 django/core/validators.py
  106. +5 −5 django/db/backends/__init__.py
  107. +2 −1 django/db/backends/creation.py
  108. +2 −1 django/db/backends/mysql/introspection.py
  109. +12 −10 django/db/backends/oracle/base.py
  110. +3 −2 django/db/backends/oracle/creation.py
  111. +9 −9 django/db/backends/sqlite3/base.py
  112. +2 −1 django/db/backends/sqlite3/creation.py
  113. +33 −32 django/db/models/base.py
  114. +13 −12 django/db/models/deletion.py
  115. +12 −9 django/db/models/fields/__init__.py
  116. +2 −2 django/db/models/fields/files.py
  117. +7 −7 django/db/models/fields/related.py
  118. +3 −2 django/db/models/loading.py
  119. +11 −12 django/db/models/options.py
  120. +12 −11 django/db/models/query.py
  121. +3 −2 django/db/models/query_utils.py
  122. +3 −3 django/db/models/related.py
  123. +4 −3 django/db/models/sql/compiler.py
  124. +15 −14 django/db/models/sql/query.py
  125. +6 −5 django/db/models/sql/subqueries.py
  126. +2 −1 django/dispatch/saferef.py
  127. +1 −1 django/forms/extras/widgets.py
  128. +14 −24 django/forms/fields.py
  129. +13 −15 django/forms/forms.py
  130. +3 −2 django/forms/formsets.py
  131. +22 −22 django/forms/models.py
  132. +6 −6 django/forms/util.py
  133. +26 −26 django/forms/widgets.py
  134. +35 −26 django/http/__init__.py
  135. +17 −9 django/http/multipartparser.py
  136. +7 −7 django/template/base.py
  137. +2 −2 django/template/debug.py
  138. +9 −9 django/template/defaultfilters.py
  139. +6 −5 django/template/defaulttags.py
  140. +3 −2 django/template/loader_tags.py
  141. +6 −2 django/template/loaders/app_directories.py
  142. +1 −1 django/templatetags/i18n.py
  143. +3 −3 django/templatetags/l10n.py
  144. +103 −16 django/test/_doctest.py
  145. +7 −7 django/test/client.py
  146. +4 −2 django/test/html.py
  147. +7 −6 django/test/testcases.py
  148. +10 −10 django/utils/_os.py
  149. +3 −4 django/utils/archive.py
  150. +2 −2 django/utils/cache.py
  151. +9 −8 django/utils/crypto.py
  152. +1 −1 django/utils/datastructures.py
  153. +3 −3 django/utils/dateformat.py
  154. +4 −3 django/utils/dateparse.py
  155. +1 −1 django/utils/dictconfig.py
  156. +43 −25 django/utils/encoding.py
  157. +21 −16 django/utils/feedgenerator.py
  158. +40 −24 django/utils/functional.py
  159. +13 −13 django/utils/html.py
  160. +15 −9 django/utils/http.py
  161. +6 −5 django/utils/regex_helper.py
  162. +2 −2 django/utils/safestring.py
  163. +1 −0 django/utils/six.py
  164. +3 −1 django/utils/termcolors.py
  165. +12 −12 django/utils/text.py
  166. +2 −2 django/utils/translation/__init__.py
  167. +3 −3 django/utils/translation/trans_null.py
  168. +24 −17 django/utils/translation/trans_real.py
  169. +2 −1 django/utils/tree.py
  170. +2 −2 django/utils/tzinfo.py
  171. +5 −5 django/views/debug.py
  172. +2 −1 django/views/generic/base.py
  173. +3 −3 django/views/generic/dates.py
  174. +3 −3 django/views/i18n.py
  175. +2 −1 docs/faq/index.txt
  176. +16 −0 docs/faq/troubleshooting.txt
  177. +1 −1 docs/howto/custom-model-fields.txt
  178. +105 −36 docs/index.txt
  179. +2 −1 docs/internals/committers.txt
  180. +10 −35 docs/internals/contributing/bugs-and-features.txt
  181. +1 −0 docs/internals/index.txt
  182. +8 −4 docs/internals/release-process.txt
  183. +215 −0 docs/internals/security.txt
  184. BIN docs/intro/_images/admin15t.png
  185. +2 −1 docs/intro/install.txt
  186. +2 −8 docs/intro/tutorial01.txt
  187. +8 −0 docs/intro/tutorial02.txt
  188. +17 −0 docs/intro/tutorial03.txt
  189. +16 −7 docs/intro/tutorial04.txt
  190. +114 −4 docs/ref/class-based-views/generic-editing.txt
  191. +3 −3 docs/ref/class-based-views/index.txt
  192. +12 −0 docs/ref/class-based-views/mixins-editing.txt
  193. BIN docs/ref/contrib/admin/_images/article_actions.png
  194. BIN docs/ref/contrib/admin/_images/article_actions_message.png
  195. BIN docs/ref/contrib/admin/_images/user_actions.png
  196. +2 −2 docs/ref/contrib/admin/index.txt
  197. +5 −5 docs/ref/contrib/comments/custom.txt
  198. +11 −0 docs/ref/contrib/gis/geos.txt
  199. +2 −0 docs/ref/contrib/gis/install.txt
  200. +5 −4 docs/ref/contrib/humanize.txt
  201. +8 −6 docs/ref/contrib/messages.txt
  202. +1 −1 docs/ref/databases.txt
  203. +1 −1 docs/ref/django-admin.txt
  204. +12 −9 docs/ref/forms/api.txt
  205. +6 −4 docs/ref/forms/validation.txt
  206. +1 −1 docs/ref/middleware.txt
  207. +35 −26 docs/ref/models/fields.txt
  208. +2 −2 docs/ref/models/instances.txt
  209. +1 −1 docs/ref/settings.txt
  210. +1 −1 docs/ref/templates/builtins.txt
  211. +12 −12 docs/ref/unicode.txt
  212. +43 −13 docs/ref/utils.txt
  213. +15 −2 docs/releases/1.5.txt
  214. +50 −34 docs/topics/auth.txt
  215. +3 −2 docs/topics/cache.txt
  216. +1 −1 docs/topics/class-based-views/index.txt
  217. +1 −1 docs/topics/db/optimization.txt
  218. +4 −0 docs/topics/forms/modelforms.txt
  219. +4 −1 docs/topics/i18n/formatting.txt
  220. +7 −1 docs/topics/i18n/translation.txt
  221. +5 −0 docs/topics/python3.txt
  222. +2 −2 docs/topics/serialization.txt
  223. +4 −4 tests/modeltests/field_subclassing/fields.py
  224. +2 −2 tests/modeltests/field_subclassing/models.py
  225. +4 −5 tests/modeltests/fixtures/tests.py
  226. +1 −2 tests/modeltests/model_forms/tests.py
  227. +1 −1 tests/modeltests/serializers/tests.py
  228. +5 −4 tests/modeltests/timezones/tests.py
  229. +1 −1 tests/modeltests/user_commands/tests.py
  230. +2 −2 tests/modeltests/validation/models.py
  231. +30 −30 tests/regressiontests/admin_filters/tests.py
  232. +1 −1 tests/regressiontests/admin_views/admin.py
  233. +2 −1 tests/regressiontests/aggregation_regress/tests.py
  234. +2 −2 tests/regressiontests/bash_completion/tests.py
  235. +1 −2 tests/regressiontests/builtin_server/tests.py
  236. +3 −3 tests/regressiontests/cache/tests.py
  237. +1 −2 tests/regressiontests/createsuperuser/tests.py
  238. +2 −1 tests/regressiontests/db_typecasts/tests.py
  239. +1 −1 tests/regressiontests/file_uploads/tests.py
  240. +7 −7 tests/regressiontests/forms/tests/extra.py
  241. +4 −20 tests/regressiontests/forms/tests/forms.py
  242. +17 −2 tests/regressiontests/httpwrappers/tests.py
  243. +4 −4 tests/regressiontests/i18n/commands/compilation.py
  244. +1 −1 tests/regressiontests/i18n/commands/extraction.py
  245. +1 −2 tests/regressiontests/inspectdb/tests.py
  246. +29 −25 tests/regressiontests/mail/tests.py
  247. +2 −2 tests/regressiontests/middleware/tests.py
  248. +4 −0 tests/regressiontests/model_fields/tests.py
  249. +4 −3 tests/regressiontests/multiple_database/tests.py
  250. +1 −1 tests/regressiontests/requests/tests.py
  251. +2 −2 tests/regressiontests/signing/tests.py
  252. +3 −3 tests/regressiontests/staticfiles_tests/tests.py
  253. +3 −3 tests/regressiontests/templates/loaders.py
  254. +3 −3 tests/regressiontests/templates/templatetags/custom.py
  255. +2 −1 tests/regressiontests/templates/tests.py
  256. +1 −1 tests/regressiontests/test_utils/tests.py
  257. +2 −1 tests/regressiontests/utils/baseconv.py
  258. +16 −12 tests/regressiontests/utils/crypto.py
  259. +1 −1 tests/regressiontests/utils/decorators.py
  260. +14 −12 tests/regressiontests/utils/http.py
  261. +18 −8 tests/regressiontests/utils/simplelazyobject.py
  262. +4 −0 tests/regressiontests/views/tests/i18n.py
View
@@ -158,7 +158,7 @@ def __getattr__(self, name):
return getattr(self.default_settings, name)
def __dir__(self):
- return self.__dict__.keys() + dir(self.default_settings)
+ return list(self.__dict__) + dir(self.default_settings)
# For Python < 2.6:
__members__ = property(lambda self: self.__dir__())
@@ -7,7 +7,7 @@
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. E Y'
TIME_FORMAT = 'G.i.s'
-# DATETIME_FORMAT =
+DATETIME_FORMAT = r'j. E Y \k\e\l\l\o G.i.s'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'j.n.Y'
@@ -1,17 +1,18 @@
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
+from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
-DATE_FORMAT = 'd F Y'
+DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = 'H:i:s'
-# DATETIME_FORMAT =
-YEAR_MONTH_FORMAT = 'F Y'
-MONTH_DAY_FORMAT = 'j F'
-SHORT_DATE_FORMAT = 'j M, Y'
-# SHORT_DATETIME_FORMAT =
-# FIRST_DAY_OF_WEEK =
+DATETIME_FORMAT = r'j \d\e F \d\e Y \s H:i'
+YEAR_MONTH_FORMAT = r'F \d\e Y'
+MONTH_DAY_FORMAT = r'j \d\e F'
+SHORT_DATE_FORMAT = 'd-m-Y'
+SHORT_DATETIME_FORMAT = 'd-m-Y, H:i'
+FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
View
@@ -1,5 +1,5 @@
from django.conf import settings
-from django.conf.urls import patterns
+from django.conf.urls import patterns, url
from django.core.urlresolvers import LocaleRegexURLResolver
def i18n_patterns(prefix, *args):
@@ -16,5 +16,5 @@ def i18n_patterns(prefix, *args):
urlpatterns = patterns('',
- (r'^setlang/$', 'django.views.i18n.set_language'),
+ url(r'^setlang/$', 'django.views.i18n.set_language', name='set_language'),
)
@@ -7,7 +7,7 @@
from django.contrib.admin.util import get_deleted_objects, model_ngettext
from django.db import router
from django.template.response import TemplateResponse
-from django.utils.encoding import force_unicode
+from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy, ugettext as _
def delete_selected(modeladmin, request, queryset):
@@ -42,7 +42,7 @@ def delete_selected(modeladmin, request, queryset):
n = queryset.count()
if n:
for obj in queryset:
- obj_display = force_unicode(obj)
+ obj_display = force_text(obj)
modeladmin.log_deletion(request, obj, obj_display)
queryset.delete()
modeladmin.message_user(request, _("Successfully deleted %(count)d %(items)s.") % {
@@ -52,9 +52,9 @@ def delete_selected(modeladmin, request, queryset):
return None
if len(queryset) == 1:
- objects_name = force_unicode(opts.verbose_name)
+ objects_name = force_text(opts.verbose_name)
else:
- objects_name = force_unicode(opts.verbose_name_plural)
+ objects_name = force_text(opts.verbose_name_plural)
if perms_needed or protected:
title = _("Cannot delete %(name)s") % {"name": objects_name}
@@ -9,7 +9,7 @@
from django.db import models
from django.core.exceptions import ImproperlyConfigured
-from django.utils.encoding import smart_unicode
+from django.utils.encoding import smart_text
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
@@ -195,7 +195,7 @@ def choices(self, cl):
}
for pk_val, val in self.lookup_choices:
yield {
- 'selected': self.lookup_val == smart_unicode(pk_val),
+ 'selected': self.lookup_val == smart_text(pk_val),
'query_string': cl.get_query_string({
self.lookup_kwarg: pk_val,
}, [self.lookup_kwarg_isnull]),
@@ -272,7 +272,7 @@ def choices(self, cl):
}
for lookup, title in self.field.flatchoices:
yield {
- 'selected': smart_unicode(lookup) == self.lookup_val,
+ 'selected': smart_text(lookup) == self.lookup_val,
'query_string': cl.get_query_string({
self.lookup_kwarg: lookup}),
'display': title,
@@ -381,7 +381,7 @@ def choices(self, cl):
if val is None:
include_none = True
continue
- val = smart_unicode(val)
+ val = smart_text(val)
yield {
'selected': self.lookup_val == val,
'query_string': cl.get_query_string({
@@ -9,7 +9,7 @@
from django.db.models.fields.related import ManyToManyRel
from django.forms.util import flatatt
from django.template.defaultfilters import capfirst
-from django.utils.encoding import force_unicode, smart_unicode
+from django.utils.encoding import force_text, smart_text
from django.utils.html import conditional_escape, format_html
from django.utils.safestring import mark_safe
from django.utils import six
@@ -94,7 +94,7 @@ def __iter__(self):
class Fieldline(object):
def __init__(self, form, field, readonly_fields=None, model_admin=None):
self.form = form # A django.forms.Form instance
- if not hasattr(field, "__iter__"):
+ if not hasattr(field, "__iter__") or isinstance(field, six.text_type):
self.fields = [field]
else:
self.fields = field
@@ -122,7 +122,7 @@ def __init__(self, form, field, is_first):
def label_tag(self):
classes = []
- contents = conditional_escape(force_unicode(self.field.label))
+ contents = conditional_escape(force_text(self.field.label))
if self.is_checkbox:
classes.append('vCheckboxLabel')
else:
@@ -166,7 +166,7 @@ def label_tag(self):
label = self.field['label']
return format_html('<label{0}>{1}:</label>',
flatatt(attrs),
- capfirst(force_unicode(label)))
+ capfirst(force_text(label)))
def contents(self):
from django.contrib.admin.templatetags.admin_list import _boolean_icon
@@ -182,7 +182,7 @@ def contents(self):
if boolean:
result_repr = _boolean_icon(value)
else:
- result_repr = smart_unicode(value)
+ result_repr = smart_text(value)
if getattr(attr, "allow_tags", False):
result_repr = mark_safe(result_repr)
else:
@@ -325,11 +325,11 @@ class AdminErrorList(forms.util.ErrorList):
"""
def __init__(self, form, inline_formsets):
if form.is_bound:
- self.extend(form.errors.values())
+ self.extend(list(six.itervalues(form.errors)))
for inline_formset in inline_formsets:
self.extend(inline_formset.non_form_errors())
for errors_in_inline_form in inline_formset.errors:
- self.extend(errors_in_inline_form.values())
+ self.extend(list(six.itervalues(errors_in_inline_form)))
def normalize_fieldsets(fieldsets):
"""
@@ -5,15 +5,15 @@
from django.contrib.auth.models import User
from django.contrib.admin.util import quote
from django.utils.translation import ugettext_lazy as _
-from django.utils.encoding import smart_unicode
+from django.utils.encoding import smart_text
ADDITION = 1
CHANGE = 2
DELETION = 3
class LogEntryManager(models.Manager):
def log_action(self, user_id, content_type_id, object_id, object_repr, action_flag, change_message=''):
- e = self.model(None, None, user_id, content_type_id, smart_unicode(object_id), object_repr[:200], action_flag, change_message)
+ e = self.model(None, None, user_id, content_type_id, smart_text(object_id), object_repr[:200], action_flag, change_message)
e.save()
class LogEntry(models.Model):
@@ -34,7 +34,7 @@ class Meta:
ordering = ('-action_time',)
def __repr__(self):
- return smart_unicode(self.action_time)
+ return smart_text(self.action_time)
def __unicode__(self):
if self.action_flag == ADDITION:
Oops, something went wrong.

0 comments on commit 184cf9a

Please sign in to comment.