This also makes migrations respect the base_manager_name and
default_manager_name model options.
Thanks Anthony King and Matthew Schinckel for the initial patches.
Backport of 2eb7cb2fffcc382979d0731370de26b051d04659 from master
This reverts commit 1b407050dd53e56686fdd3e168f8cac4f9be8306 as it
introduces a regression in the test for refs #26772.
Backport of cd217de6100e0101fd921dd18bc2e706bac397c9 from master
Fixed a regression in 2f16ff5a6cbd71fc6c50e88e4087f3657222e90e.
Thanks Tim Graham for the review.
Backport of 625b8e9295d79650208bfb3fca8bf9e6aaf578e4 from master
This reverts commit a52a531a8b34f049fba11c3ee7b010af7534bf90 due to
regressions described in refs #26772.
Backport of 7def55c3f6716fcfa40a3bd5d0fbb2090588d81e from master
914c72be2abb1c6dd860cb9279beaa66409ae1b2 introduced a regression that
causes saving a NamedTemporaryFile in a FileField to raise a
SuspiciousFileOperation. To remedy this, if a File has an absolute
path as a filename, use only the basename as the filename.
Backport of 1b407050dd53e56686fdd3e168f8cac4f9be8306 from master
Made it consistently read the PO file, decode its contents and then
check for the non-breaking space Unicode code point.
Previously we were erroneously skipping the interpretation of what we
read as UTF-8 text.
This was causing the test to fail on Windows with Python 3.5.
Backport of 1b00ed088073ffd268af15d25246d2565253536d from master
This behavior was removed in 67d984413c9540074e4fe6aa033081a35cf192bc
but is needed to prevent a crash in formtools.
Backport of a4c20ae85b40c49e28d1b2227208e4f00d7820df from master
Broke the initial migration in two to work around #25530 and added
'django.contrib.auth' to the available_apps to make sure its tables are also
flushed as Oracle doesn't implement cascade deletion in sql_flush().
Thanks Tim for the report.
Backport of 722344ee59fb89ea2cd5b906d61b35f76579de4e from master
Note that the cookie is not changed every request, just the token retrieved
by the `get_token()` method (used also by the `{% csrf_token %}` tag).
While at it, made token validation strict: Where, before, any length was
accepted and non-ASCII chars were ignored, we now treat anything other than
`[A-Za-z0-9]{64}` as invalid (except for 32-char tokens, which, for
backwards-compatibility, are accepted and replaced by 64-char ones).
Thanks Trac user patrys for reporting, github user adambrenecki
for initial patch, Tim Graham for help, and Curtis Maloney,
Collin Anderson, Florian Apolloner, Markus Holtermann & Jon Dufresne
for reviews.
This deprecates use_for_related_fields.
Old API:
class CustomManager(models.Model):
use_for_related_fields = True
class Model(models.Model):
custom_manager = CustomManager()
New API:
class Model(models.Model):
custom_manager = CustomManager()
class Meta:
base_manager_name = 'custom_manager'
Refs #20932, #25897.
Thanks Carl Meyer for the guidance throughout this work.
Thanks Tim Graham for writing the docs.