From 0f524f56864e8894a8229d16a96582d80c78d939 Mon Sep 17 00:00:00 2001 From: Adam Radwon Date: Tue, 10 Mar 2020 08:14:30 +0000 Subject: [PATCH] [3.0.x] Fixed #27865 -- Adjusted docs example to avoid confusion with models.BaseManager. Backport of a2f554249ec07d4643643773a995579f98564ac1 from master --- docs/topics/db/managers.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/topics/db/managers.txt b/docs/topics/db/managers.txt index aa41eb648d..de06d94947 100644 --- a/docs/topics/db/managers.txt +++ b/docs/topics/db/managers.txt @@ -330,7 +330,7 @@ For advanced usage you might want both a custom ``Manager`` and a custom returns a *subclass* of your base ``Manager`` with a copy of the custom ``QuerySet`` methods:: - class BaseManager(models.Manager): + class CustomManager(models.Manager): def manager_only_method(self): return @@ -339,14 +339,14 @@ returns a *subclass* of your base ``Manager`` with a copy of the custom return class MyModel(models.Model): - objects = BaseManager.from_queryset(CustomQuerySet)() + objects = CustomManager.from_queryset(CustomQuerySet)() You may also store the generated class into a variable:: - CustomManager = BaseManager.from_queryset(CustomQuerySet) + MyManager = CustomManager.from_queryset(CustomQuerySet) class MyModel(models.Model): - objects = CustomManager() + objects = MyManager() .. _custom-managers-and-inheritance: