[Django] #30688: Add example usage for Meta.base_manager_name

4 views
Skip to first unread message

Django

unread,
Aug 8, 2019, 12:28:09 AM8/8/19
to django-...@googlegroups.com
#30688: Add example usage for Meta.base_manager_name
-----------------------------------------+------------------------
Reporter: agilgur5 | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 2.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
There is currently no documentation in topics or the reference about how
''specifically'' to use `Meta.base_manager_name` and I think an example
could alleviate the confusion this causes.

I had some trouble in a library I maintain (https://github.com/agilgur5
/django-serializable-model/issues/4#issuecomment-519338032), where I
mistakenly thought that `base_manager_name` should be set to,
''literally'' the name of the manager, as in the string equivalent to the
name of the class of the manager (in my case, `'SerializableManager'`),
similar to how one may reference models by string.
Through finding some examples online like
https://stackoverflow.com/a/48124863/3431180, I realized it's supposed to
be the name of the attribute on the current class that contains the
instance of the manager (in my case, `'objects'`).

An example would really clear things up very concisely.

--
Ticket URL: <https://code.djangoproject.com/ticket/30688>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 8, 2019, 12:33:27 AM8/8/19
to django-...@googlegroups.com
#30688: Add example usage for Meta.base_manager_name
-------------------------------+--------------------------------------
Reporter: agilgur5 | Owner: agilgur5
Type: Uncategorized | Status: assigned
Component: Documentation | Version: 2.2
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by agilgur5):

* owner: nobody => agilgur5
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/30688#comment:1>

Django

unread,
Aug 8, 2019, 3:31:06 AM8/8/19
to django-...@googlegroups.com
#30688: Clarify docs for Options.base_manager_name.
--------------------------------------+------------------------------------
Reporter: agilgur5 | Owner: agilgur5
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Carlton Gibson):

* needs_better_patch: 0 => 1
* version: 2.2 => master
* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Accepted


Comment:

Thanks for this! Yes, but as per comment on PR, I think a clarification of
the
[https://docs.djangoproject.com/en/2.2/ref/models/options/#django.db.models.Options.base_manager_name
Options.base_manager_name] description is what's needed.

Currently, "The name of the manager..." is ambiguous as you say. Narrowing
that to "The attribute name...", adding perhaps "... for example
`'objects'`..." if we think that's clearer should be enough.

--
Ticket URL: <https://code.djangoproject.com/ticket/30688#comment:2>

Django

unread,
Aug 9, 2019, 4:09:31 AM8/9/19
to django-...@googlegroups.com
#30688: Clarify docs for Options.base_manager_name.
-------------------------------------+-------------------------------------
Reporter: Anton Gilgur | Owner: Anton
Type: | Gilgur
Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson <carlton.gibson@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"514efa3129792ec2abb2444f3e7aeb3f21a38386" 514efa31]:
{{{
#!CommitTicketReference repository=""
revision="514efa3129792ec2abb2444f3e7aeb3f21a38386"
Fixed #30688 -- Clarified base_manager_name docs.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30688#comment:3>

Django

unread,
Aug 9, 2019, 4:11:17 AM8/9/19
to django-...@googlegroups.com
#30688: Clarify docs for Options.base_manager_name.
-------------------------------------+-------------------------------------
Reporter: Anton Gilgur | Owner: Anton
Type: | Gilgur
Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson <carlton.gibson@…>):

In [changeset:"c5cbb797d7b90aa5d262c46520e631c0ae7f5204" c5cbb797]:
{{{
#!CommitTicketReference repository=""
revision="c5cbb797d7b90aa5d262c46520e631c0ae7f5204"
[2.2.x] Fixed #30688 -- Clarified base_manager_name docs.

Backport of 514efa3129792ec2abb2444f3e7aeb3f21a38386 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30688#comment:4>

Reply all
Reply to author
Forward
0 new messages