1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #10506, #13793, #14891, #25201 -- Introduced new APIs to specify models' default and base managers.

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.
This commit is contained in:
Loïc Bistuer
2016-04-17 18:55:55 +07:00
parent 3a47d42fa3
commit ed0ff913c6
18 changed files with 815 additions and 226 deletions

View File

@@ -175,6 +175,12 @@ details on these changes.
* The ``escape`` filter will change to use
``django.utils.html.conditional_escape()``.
* ``Manager.use_for_related_fields`` will be removed.
* Model ``Manager`` inheritance will follow MRO inheritance rules and the
``Meta.manager_inheritance_from_future`` to opt-in to this behavior will be
removed.
.. _deprecation-removed-in-1.10:
1.10