1
0
mirror of https://github.com/django/django.git synced 2025-04-09 15:59:41 +00:00

12029 Commits

Author SHA1 Message Date
Tim Graham
c0f0f93b5d [1.8.x] Moved contrib.redirects tests out of contrib.
Backport of 00da46091a0b35d4822b30e29334de4f4869901e from master
2015-02-11 11:55:40 -05:00
Tim Graham
bbe7964185 [1.8.x] Moved contrib.messages tests out of contrib.
Backport of b3cd9e0d0732e1fd7d2afd5825dda5b3857927da from master
2015-02-11 11:55:05 -05:00
Tim Graham
10fdd2fc1d [1.8.x] Moved contrib.sessions tests out of contrib.
Backport of fac3a34cbb8fd8dc74006f187dd1e83f3a040d39 from master
2015-02-11 11:54:51 -05:00
Tim Graham
e1046a96bc [1.8.x] Moved contrib.sitemaps tests out of contrib.
Backport of fbc467c26bc0adb9867b97d0bb5642b2a85eb357 from master
2015-02-11 11:52:10 -05:00
Tim Graham
0520cfe94a [1.8.x] Moved contrib.sites tests out of contrib.
Backport of d8341bf02444e58ff62afe04f15d9679a1b5b8f8 from master
2015-02-11 11:50:23 -05:00
Tim Graham
36bf6ec9eb [1.8.x] Moved contrib.flatpages tests out of contrib.
Backport of d3a725054fa260e84c788b240fd03cbd0ccc1151 from master
2015-02-11 11:47:58 -05:00
Tim Graham
a0553d1a7c [1.8.x] Prevented some test commands from needlessly running system checks.
This is a performance optimization and also fixes test errors with the
upcoming merge of contrib tests into tests/. The tests failed on MySQL
because the models with GeometryField were being checked but the
non-GIS MySQL backend didn't know how to handle them.

Backport of 197dd4b8f12164f6acebb3b959f9ac2040a40400 from master
2015-02-11 10:17:53 -05:00
Daniel Pyrathon
fdcc9c47d5 [1.8.x] Fixed #24146 -- Allowed model._meta.get_field() to be used after apps.models_ready
Backport of 19188826b4aa989475418f1ea9bf8631b04da1e8 from master
2015-02-10 19:55:42 -05:00
Aymeric Augustin
c6a49d4f17 [1.8.x] Fixed a crash of the debug page.
During the autumn DST change, the template engine would fail to convert
the naive representation of now when USE_TZ = True. Passing now in UTC
eliminates the issue.

Thanks mbertheau and tricoder42.

Refs #23714.

Backport of c7a6996df7e77bc3b9c5e581e67d766627ebabec from master
2015-02-10 19:07:07 -05:00
Loic Bistuer
00f76b018f [1.8.x] Fixed isort import that's inconsistent between platforms.
Backport of c8e24bbc9b027a712b54e3665d27418ae538f15d from master
2015-02-10 18:53:23 -05:00
Josh Smeaton
3518d51697 [1.8.x] Fixed #24200 -- Made introspection bypass statement cache
Backport of 1fbe8a2de3 from master
2015-02-10 23:42:16 +02:00
Aymeric Augustin
9b7b37382c [1.8.x] Split DTL context creation into its own function.
This reduces the length of rope RequestContext gives users to hang
themselves with.

Thanks Alex Hill for the report and Tim Graham for the review.

Backport of f2c104a from master.
2015-02-10 14:35:05 +01:00
Tim Graham
a8b70d251d [1.8.x] Sorted imports with isort; refs #23860.
Backport of 0ed7d155635da9f79d4dd67e4889087d3673c6da from master
2015-02-09 14:24:06 -05:00
Tim Graham
9744529c12 [1.8.x] Fixed #24302 -- Added DurationField.formfield()
Backport of 2d7c27d3870e57edd1b2ac46b49f0a8804753a1e from master
2015-02-09 10:21:15 -05:00
jMyles
ac576e9f45 [1.8.x] Fixed #24287 -- Added friendly error if a model is in a models.py outside an installed app. 2015-02-09 09:38:03 -05:00
Tim Graham
6e50fc9246 [1.8.x] Removed unnecessary parentheses in model check messages.
Backport of e144e0e237136f8bf1831f645c3dde4541d629b0 from master
2015-02-09 08:57:02 -05:00
Aron Podrigal
eb9fbc0b1d [1.8.x] Fixed #24249 -- Improved field shadowing validation in model multi-inheritance.
Backport of 4d73303ee974c5f1ea6af984d4578d817825026d from master
2015-02-09 08:43:40 -05:00
Aymeric Augustin
8cb2cfdda5 [1.8.x] Called parent in SimpleTestCase.setUpClass/tearDownClass.
Backport of 146dd7be8dad4cd6264d374b681256a8b0d5808b from master
2015-02-08 21:31:28 -05:00
Claude Paroz
cd260d03bd [1.8.x] Replaced hardcoded URLs in admin_* tests
Refs #15779. This will allow easier admin URL changes, when needed.
Thanks Simon Charette for the review.

Backport of 32e6a7d3a57b2287d55e8b8efa4e8cb7643b1720 from master
2015-02-08 15:12:07 -05:00
Alex Gaynor
d54638727a [1.8.x] Simplified the lazy CSRF token implementation in csrf context processor.
This significantly improves performance on PyPy. The previous
implementation would generate a new class on every single request,
which is relatively slow.

Backport of 8099d33b6553c9ee7de779ae9d191a1bf22adbda from master
2015-02-08 15:03:29 -05:00
Alex Gaynor
ee86bf24d2 [1.8.x] Optimized allow_lazy() by not generating a new lazy wrapper on each invocation.
This dramatically improves performance on PyPy. The following benchmark:

python -mtimeit -s "from django.utils.functional import allow_lazy; from django.utils.translation import ugettext_lazy; f = allow_lazy(lambda s: s, str)" "f(ugettext_lazy('abc'))"

goes from 390us per loop to 165us.

Backport of 82e0cd15711c7171aed7af5e481967cc721c9642 from master
2015-02-08 14:57:19 -05:00
Varun Sharma
b44a56c308 [1.8.x] Fixed #24181 -- Fixed multi-char THOUSAND_SEPARATOR insertion
Report and original patch by Kay Cha.
Backport of 540ca563de from master.
2015-02-08 20:09:04 +01:00
Markus Holtermann
edbf6de753 [1.8.x] Revert "Fixed #24075 -- Prevented running post_migrate signals when unapplying initial migrations of contenttypes and auth"
This reverts commit 737d24923ac69bb8b89af1bb2f3f4c4c744349e8.

Backport of 2832a9b028c267997b2fd3dd0989670d57cdd08f from master
2015-02-07 20:35:20 +01:00
Markus Holtermann
b2b5ea88b7 [1.8.x] Revert "Refs #24075 -- Silenced needless call_command output while running tests"
This reverts commit 51dc617b21e67636d96cf645905797a4d6ff4bf0.

Backport of bd3d796ecd9a66832ad26024df65caeb63b60a5d from master
2015-02-07 19:52:50 +01:00
Collin Anderson
fc8e1e0c10 [1.8.x] Fixed E265 comment style
Backport of db77915c9fd35a203edd8206f702ee4082f04d4a from master
2015-02-06 09:35:08 -05:00
Tim Graham
232a1d297c [1.8.x] Removed django-2to3.py
Aymeric says, "It was fun to write, but I don't think it's very useful."

Backport of 607af78bb82404d55cc3e80e5f6772fb87c168ee from master
2015-02-06 08:56:01 -05:00
Tim Graham
289660f52d [1.8.x] Removed bin/unique-messages.py
This script is no longer used according to Claude, our translations manager.

Backport of eb45a29565fe006b87657e9ee24054c66a6474f9 from master
2015-02-06 08:55:10 -05:00
Tim Graham
6adc23d6b6 [1.8.x] Removed gather_profile_stats.py
This script uses the unmaintained hotshot module (gone on Python 3)
and doesn't seem to be Django specific in any way.

Backport of 388d986b8a6bb1363dab9f53ea435dff4dfe92cb from master
2015-02-06 08:55:02 -05:00
Tim Graham
fc1e9107d7 [1.8.x] Added UUIDField.deconstruct()
Backport of 0f54cf28c09a80254571487e3af93be2096cfdac from master
2015-02-05 19:15:37 -05:00
Aymeric Augustin
aed1b1f6e5 [1.8.x] Fixed #24265 -- Preserved template backend loading exceptions.
If importing or initializing a template backend fails, attempting to
access this template backend again must raise the same exception.

Backport of 44ad6915 from master
2015-02-05 20:09:22 +01:00
Aymeric Augustin
67787db22a [1.8.x] Caught all exceptions raised by Engine.get_default().
In addition to ImproperlyConfigured, Engine.get_default() may also raise
ImportError or other exceptions. It's better to catch all exceptions in
places where the default engine isn't strictly required.

Backport of 27f9ff45 from master
2015-02-05 20:09:10 +01:00
Aymeric Augustin
5fbec369aa [1.8.x] Fixed #24273 -- Allowed copying RequestContext more than once.
Thanks Collin Anderson for the report.

Backport of 31d3a355 from master
2015-02-05 14:07:18 +01:00
Matthew Somerville
2a55301f9f [1.8.x] Fixed #24242 -- Improved efficiency of utils.text.compress_sequence()
The function no longer flushes zfile after each write as doing so can
lead to the gzipped streamed content being larger than the original
content; each flush adds a 5/6 byte type 0 block. Removing this means
buf.read() may return nothing, so only yield if that has some data.
Testing shows without the flush() the buffer is being flushed every 17k
or so and compresses the same as if it had been done as a whole string.

Backport of caa3562d5bec1196502352a715a539bdb0f73c2d from master
2015-02-04 15:17:22 -05:00
mlavin
d585ade0df [1.8.x] Fixed #24197 -- Added clearing of staticfiles caches on settings changes during tests
Cleared caching in staticfiles_storage and get_finder when
relevant settings are changed.

Backport of 2730dad0d7c425f33f1ecc6cec01fdbf1cdd8376 from master
2015-02-04 10:54:33 -05:00
Riccardo Magliocchetti
4957b8a406 [1.8.x] Fixed #14497 -- Improved admin widget for "read only" FileFields
Based on patch by Adam J Forster, Paul Collins, and Julien.

Backport of 2be621e44c1b5b68c895383f3e20b1f17ddb447a from master
2015-02-04 09:05:41 -05:00
Aron Podrigal
fc49e73648 [1.8.x] Fixed #15321 -- Honored ancestors unique checks.
Thanks to Tim for the review.

Backport of 79f27f2b61aeac763ae048416ef8a97c2b639ae8 from master
2015-02-03 18:58:48 -05:00
Simon Charette
cbcf92e95f [1.8.x] Fixed #24266 -- Changed get_parent_list to return a list ordered by MRO.
Thanks to Aron Podrigal for the initial patch and Tim for the review.

Backport of 65e005f8cd9c656e558e53e6c8b890cd0fcc9e74 from master
2015-02-03 16:41:51 -05:00
Tim Graham
92d5bedc56 [1.8.x] Reverted "Fixed #24146 -- Fixed a missing fields regression in admin checks."
This reverts commit e8171daf0cd7f0e070395cb4c850c17fea32f11d.

A new solution is forthcoming.

Backport of 0e489c19f1554ecfd9825daacfbac73be8ce723e from master
2015-02-03 15:24:24 -05:00
Claude Paroz
ea3e40c278 [1.8.x] Fixed #24252 -- Forced lazy __str__ to utf-8 on Python 2
Thanks Stanislas Guerra for the report and Tomas Ehrlich for
the review.
Backport of cd0ceaa102 from master.
2015-02-03 18:26:08 +01:00
Matthew Somerville
d88c24f436 [1.8.x] Fixed #24240 -- Allowed GZipping a Unicode StreamingHttpResponse
make_bytes() assumed that if the Content-Encoding header is set, then
everything had already been dealt with bytes-wise, but in a streaming
situation this was not necessarily the case.

make_bytes() is only called when necessary when working with a
StreamingHttpResponse iterable, but by that point the middleware has
added the Content-Encoding header and thus make_bytes() tried to call
bytes(value) (and dies). If it had been a normal HttpResponse,
make_bytes() would have been called when the content was set, well
before the middleware set the Content-Encoding header.

This commit removes the special casing when Content-Encoding is set,
allowing unicode strings to be encoded during the iteration before they
are e.g. gzipped. This behaviour was added a long time ago for #4969 and
it doesn't appear to be necessary any more, as everything is correctly
made into bytes at the appropriate places.

Two new tests, to show that supplying non-ASCII characters to a
StreamingHttpResponse works fine normally, and when passed through the
GZip middleware (the latter dies without the change to make_bytes()).
Removes the test with a nonsense Content-Encoding and Unicode input - if
this were to happen, it can still be encoded as bytes fine.

Backport of 250aa7c39b from master.
2015-02-03 18:19:06 +01:00
Anssi Kääriäinen
43b0131fb5 [1.8.x] Fixed #23617 -- Added get_pk_value_on_save()
The method is mainly intended for use with UUIDField. For UUIDField we
want to call the field's default even when primary key value is
explicitly set to None to match the behavior of AutoField.

Thanks to Marc Tamlyn and Tim Graham for review.

Backport of 8adc59038cdc6ce4f9170e4de2d716d940e136b3 from master
2015-02-03 09:25:55 -05:00
Tim Graham
9ffe013caa [1.8.x] Fixed #24263 -- Prevented extra queries on BaseDateDetailView with a custom queryset.
Thanks jekka-ua for the report and patch.

Backport of 118b11221f7f632b4d0e6e976c87f563746ec211 from master
2015-02-03 09:13:10 -05:00
Tim Graham
c65c8f5696 [1.8.x] Skipped tests from refs #24168 on Python 3.2. 2015-02-03 08:21:06 -05:00
Aymeric Augustin
f87457a460 [1.8.x] Fixed #24168 -- Allowed selecting a template engine in a few APIs.
Specifically in rendering shortcuts, template responses, and class-based
views that return template responses.

Also added a test for render_to_response(status=...) which was missing
from fdbfc980.

Thanks Tim and Carl for the review.

Backport of 2133f31 from master.

Conflicts:
	docs/topics/http/shortcuts.txt
	tests/generic_views/test_base.py
2015-02-03 08:32:14 +01:00
Tim Graham
3af1e7860e [1.8.x] Removed contrib.auth.forms.mask_password()
This function is unused since dce820ff70f00e974afd3e6e310aa825bc55319f
after being introduced in 718a5ba1a1a77374c26b134ded46dab13776d1a1

Backport of a53541852d5601232899e54d66e623bc163c6dc2 from master
2015-02-02 11:13:48 -05:00
Tim Graham
3cd8f51f21 [1.8.x] Removed query.alias_diff()
This function is unused since 6fe2b001dba45134d7c10729c57959995e241a88

Backport of f79ce63fdb6788c8b4857fece6c86de57fc129ee from master
2015-02-01 21:38:34 -05:00
Tim Graham
c9df163d0c [1.8.x] Removed UpdateCacheMiddleware._session_accessed()
This method is unused since f567d04b249913db4a37adab8ba521cdc974d423

Backport of 0e6091249295b0e06aff2b1b4411819f94a1c529 from master
2015-02-01 20:35:57 -05:00
Tim Graham
7580876fbd [1.8.x] Removed Query.raise_field_error()
This method was inadvertently reintroduced in
f59fd15c4928caf3dfcbd50f6ab47be409a43b01

Backport of 99ca7c2bd3e04b343f4a0fe2d5add7c6d6f3a456 from master
2015-02-01 20:26:43 -05:00
Tim Graham
26e07a996d [1.8.x] Removed InlineAdminForm.field_count()
This method is unused since 337d102b8612503bb9dc712bfbf07432a9a96302

Backport of 327a00f48b71b5f82788f3c9ee3cdb25b8e1ef1a from master
2015-02-01 20:13:58 -05:00
Tim Graham
c9e538b174 [1.8.x] Removed threading fallback imports.
Django imports threading in many other places without fallback.

Backport of 18f3e79b13947de0bda7c985916d5a04e28936dc from master
2015-02-01 18:45:01 -05:00