Commit Graph

26119 Commits

Author SHA1 Message Date
Simon Charette 1e9b02a4c2 Refs #28862 -- Removed the FieldRelatedOptionOperation.reduce() optimization.
It isn't required anymore since AlterTogetherOperations can be reduced into
CreateModels which can reduce DeleteField operations.
2018-07-19 17:42:18 -04:00
Simon Charette fc16015de4 Fixed #26906 -- Reduced alter together operations code duplication.
Thanks Akshesh Doshi for the initial patch.
2018-07-19 17:06:01 -04:00
Simon Charette 8e3f22f251 Fixed #27731 -- Implemented CreateModel/AlterFooOperation reduction.
This should alleviate the side effects of disabling the AlterFooOperation
reduction with RemoveField to fix refs #28862 during migration squashing
because CreateModel can perform a reduction with RemoveField.

Thanks Nick Pope for the review.
2018-07-19 17:06:01 -04:00
Simon Charette ed7898e1b5 Fixed #28862 -- Disabled optimization of AlterFooTogether and RemoveField.
AlterFooTogether operations cannot be swapped with RemoveField operations on
the same model as they could be removing the the same field as well.

Since AlterFooTogether operations don't track what their previous value was,
it's impossible to determine whether or not the optimization is safe so the
only way to proceed is to disable the optimization.

Thanks Ramiro Morales for the in-depth analysis of the issue.

Refs #24828
2018-07-19 17:06:01 -04:00
Hasan Ramezani 55b6f7af0c Completed test coverage for django.urls.utils.get_callable(). 2018-07-19 16:48:23 -04:00
Claude Paroz 0adfba968e Fixed #29578 -- Made numberformat.format() honor forced l10n usage.
Thanks Sassan Haradji for the report.
2018-07-19 16:44:40 -04:00
Tim Graham 6b6bdfe25c Fixed IntegrityError in docs/topics/db/examples/many_to_one.txt. 2018-07-19 15:47:20 -04:00
Claude Paroz 1ed8527e3d Fixed utils.html.escape()'s docs with regards to string coercion.
As of 301de774c2.
2018-07-18 14:15:42 -04:00
Mariusz Felisiak a73cf8110e Removed duplicate words in various comments. 2018-07-18 11:54:15 -04:00
Claude Paroz 6e78e10549 Added doc links for django.utils.html.escape(). 2018-07-18 11:32:27 -04:00
Maxime Lorant 31407fa3b3 Removed duplicate words in docs.
.
2018-07-18 11:24:06 -04:00
Viktor Danyliuk 6ae7aaa7d6 Fixed #29413 -- Prevented evaluation of QuerySet.get_or_create()/update_or_create() defaults unless needed.
Removed the logic added in 81e05a418d which
was obsolete since dbffffa7dc.
2018-07-16 22:08:43 -04:00
Josh Schneier 4d48ddd8f9 Fixed #28917 -- Prevented Paginator's unordered warning on EmptyQuerySet.
Thanks carltongibson for the idea and weijunji for the initial patch.
2018-07-16 14:28:47 -04:00
François Freitag 93e721a0b8 Fixed django/http/request.py docstring typo. 2018-07-16 10:48:20 +02:00
Mariusz Felisiak dd3b470719
Fixed #29542 -- Fixed invalid SQL if a Subquery from the HAVING clause is used in the GROUP BY clause.
Thanks Tim Graham for the review.
2018-07-14 12:03:22 +02:00
Peter Inglesby 312eb5cb11 Fixed #26291 -- Allowed loaddata to handle forward references in natural_key fixtures. 2018-07-13 17:54:47 -04:00
Daniel Wiesmann 8f75d21a2e Fixed #28566 -- Added path matching to collectstatic ignore patterns. 2018-07-13 16:48:19 -04:00
Claude Paroz c28bf990d7 Refs #29548 -- Fixed GIS tests on MariaDB 2018-07-13 18:27:30 +02:00
Oliver Sauder a07a49ee32 Fixed #29559 -- Fixed TransactionTestCase.reset_sequences for auto-created m2m through models. 2018-07-11 17:20:29 -04:00
Tim Graham 4d98b9d729 Refs #9804 -- Fixed test for sequence reset of M2M with inherited through model. 2018-07-11 16:45:29 -04:00
Simon Charette 8a03445885 Removed in_between from Operation.reduce()'s signature.
It isn't used since FieldOperation.references_model() takes into
account models referenced by the field it's operating on.
2018-07-11 10:49:50 -04:00
Simon Charette 37cafbfb79 Fixed #27845 -- Allowed both right and left optimizations of operations.
Thanks Raphael Gaschignard for the suggestion.
2018-07-11 10:49:50 -04:00
Simon Charette 0025dd5eb4 Allowed RemoveField operations to be optimized through. 2018-07-11 10:49:50 -04:00
Simon Charette 50b8c98a0f Relaxed FieldOperation.references_field remote field checking. 2018-07-11 10:49:50 -04:00
Simon Charette 013bcf57d5 Introduced ModelTuple to remove migrations boilerplate. 2018-07-11 10:49:50 -04:00
Simon Charette ad82900ad9 Fixed #26720 -- Prevented invalid CreateModel optimizations of related fields. 2018-07-11 10:49:50 -04:00
Simon Charette a97845a823 Fixed #27768 -- Allowed migration optimization of CreateModel order.
Thanks Ed Morley from Mozilla for the tests.
2018-07-11 10:49:50 -04:00
Simon Charette d3a935f01f Refs #27768 -- Reversed order of optimized and in-between operations.
Operations can only be optimized through if they don't reference any of the
state the operation they are compared against defines or alters, so it's
safe to reverse the order.
2018-07-11 10:49:50 -04:00
Sergey Fedoseev 529c3f264d Simplified BaseContext.__iter__(). 2018-07-11 09:12:50 -04:00
Jon Dufresne e26b780a24 Silenced warnings in deprecation tests. 2018-07-11 09:10:31 -04:00
Simon Charette e4c0878b30 Refs #22875 -- Fixed an optimizer test to use a valid scenario.
An explicit intermediary many-to-many relationship must declare forward and
reverse foreign keys. The original issue was in the autodetector as these
operations shouldn't have been generated in this order in the first place
which is tested by AutodetectorTests.test_create_with_through_model.
2018-07-10 16:47:57 -04:00
Jonah Bishop 263e039411 Fixed #29045 -- Fixed admin CSS so that select multiple elements honor the HTML size attribute. 2018-07-10 16:22:09 -04:00
Ian Foote 952f05a6db Fixed #11964 -- Added support for database check constraints. 2018-07-10 15:32:33 -04:00
Sergey Fedoseev 6fbfb5cb96 Removed Oracle's fetchmany() and fetchall() wrappers.
Follow up to e06cab2600.
2018-07-10 15:03:09 -04:00
Jon Dufresne 08ebed5e79 Fixed #29556 -- Made 'remove_stale_contenttypes --noinput' delete content types. 2018-07-10 10:14:34 -04:00
Tim Graham 178624855a Simplified a couple test docstrings. 2018-07-10 09:43:12 -04:00
Mads Jensen 8e4a75e5d5 Deleted unused variable in SQLCompiler.get_related_selections().
Unused since 01d440fa1e.
2018-07-10 09:15:19 -04:00
Sergey Fedoseev bcdd9149d4 Simplified HttpRequest.__iter__(). 2018-07-10 09:13:36 -04:00
Jon Dufresne e7d7d47b93 Fixed ResourceWarning from unclosed test files.
When running Django tests with Python warnings enabled.
2018-07-10 12:26:19 +02:00
Sergey Fedoseev 338f741c5e Fixed #29546 -- Deprecated django.utils.timezone.FixedOffset. 2018-07-09 16:33:36 -04:00
Tim Graham 8b1d361f28
Fixed #29549 -- Doc'd that Field.choices are enforced by model validation. 2018-07-09 15:06:36 -04:00
Tom Forbes 45c035c823 Refs #29548 -- Fixed non-GIS test failures on MariaDB. 2018-07-09 14:59:42 -04:00
Sergey Fedoseev 7d6fe18dde Simplified force_bytes(). 2018-07-09 12:25:55 -04:00
Sergey Fedoseev 09199734d3 Refs #29478 -- Doc'd how to use cached_property with a mangled name. 2018-07-09 12:13:31 -04:00
Simon Charette 37835883ad Fixed #29550 -- Eased overriding pickle.dumps() protocol in cache backends and session serializer. 2018-07-09 11:46:55 -04:00
Simon Charette 2d75509bcb Refs #27480 -- Moved FileBasedCache content writing logic to a method. 2018-07-09 11:46:03 -04:00
Tim Graham 5bea8d256d
Fixed #29553 -- Made test client set Content-Length header to a string rather than integer. 2018-07-09 11:44:49 -04:00
Sergey Fedoseev 857f860d56 Removed unneded str() calls prior to mark_safe(); simplified mark_safe(). 2018-07-09 11:25:11 -04:00
Sergey Fedoseev c9088cfc7b Fixed some assertTrue() that were intended to be assertEqual(). 2018-07-09 11:13:40 -04:00
Sergey Fedoseev 3411c5551a Refs #27472 -- Fixed crash during pickling of empty GEOS point. 2018-07-09 11:02:12 -04:00