diff options
| author | Adam Radwon <dev@radwon.com> | 2020-03-10 08:14:30 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-10 09:14:30 +0100 |
| commit | a2f554249ec07d4643643773a995579f98564ac1 (patch) | |
| tree | c6c4f6678a35d15cb4a2201f3441cb126daba681 /docs | |
| parent | 5e17301f38d0a4f372d4d36762a464f5f4714ebd (diff) | |
Fixed #27865 -- Adjusted docs example to avoid confusion with models.BaseManager.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/db/managers.txt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/topics/db/managers.txt b/docs/topics/db/managers.txt index 3ab50e54a2..ec29d7b639 100644 --- a/docs/topics/db/managers.txt +++ b/docs/topics/db/managers.txt @@ -329,7 +329,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 @@ -338,14 +338,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: |
