Conflicts:
tests/apps/tests.py
tests/migrations/test_graph.py
tests/queryset_pickle/tests.py
tests/runtests.py
Backport of 1c5f4e86bc9c7bae5d5f3830d9cfbb0043297261 from master
Instead of using DjangoJSONEncoder, use base_field's value_to_string().
Note this means the serialization of e.g. IntegerRangeField now has
strings for lower and upper, so use to_python when they came back in
(same behaviour as ArrayField, hopefully, from where I also got the
set_attributes_from_name function).
Backport of 86d9b10dc33cc115fee2ecab40a569354ac55d15 and
8a842148b6deaab021526e2689279cf5e232945f from master
This only happens if USE_TZ = False and pytz is installed (perhaps not
the most logical combination, but who am I to jugde?)
Refs #23714 which essentially fixed the same problem when USE_TZ = True.
Thanks Florian and Carl for insisting until I wrote a complete patch.
Backport of 1014ba026e from master
Some third-party database backends (MSSQL) have custom
delete_model() requirements that must be executed.
Backport of 4dcc2a195595f8d7ddad45bc4baf98ffdeec7f41 from master
Fixed situation when parent abstract model declares related_name='+'
and child models had an invalid queryset.
Backport of f7b297815819153b53dc1125d3f42869fb1b7ebc from master
Pickling a `SimpleLazyObject` wrapping a model did not work correctly; in
particular it did not add the `_django_version` attribute added in 42736ac8.
Now it will handle this and other custom `__reduce__` methods correctly.
Backport of 35355a4ffedb2aeed52d5fe3034380ffc6a438db from master
Added support for multiple m2m fields with the same 'to' model
and with related_name set to '+'.
Backport of 4ee08958f154594b538207a53c1d457687b3f7ae from master
This commits lifts the restriction that the outermost atomic block must
be declared with savepoint=False. This restriction was overly cautious.
The logic that makes it safe not to create savepoints for inner blocks
also applies to the outermost block when autocommit is disabled and a
transaction is already active.
This makes it possible to use the ORM after set_autocommit(False).
Previously it didn't work because ORM write operations are protected
with atomic(savepoint=False).
Backport of 91e9f1c from master
Too much field exclusions in form's construct_instance() in _post_clean()
could lead to some unexpected missing ForeignKey values.
Fixes a regression from 45e049937. Refs #13776.
Backport of 65a1055a3 from master.
Moved data loss check when assigning to a reverse one-to-one relation on
an unsaved instance to Model.save(). This is exactly the same change as
e4b813c but for reverse relations.
Backport of c3904de from master
This also fixes a test failure on Python 2 when Django is installed in a
non-ASCII path. This problem cannot happen on Python 3.
Backport of c2fcba2ac7 from master
* Added helpers to test uncached and cached access.
* Fixed test_project_root_locale: it duplicated test_locale_paths_setting.
* Rewrote test_only_new_files: test more cases.
Backport of dfa712efb8 from master
* When some old files contain errors, the second call to
gen_filenames() should return them.
* When some new files contain errors, the first call to
gen_filenames(only_new=True) should return them.
Backport of 23620cb8e0 from master