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.
* owner: nobody => agilgur5
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/30688#comment:1>
* 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>
* 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>
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>