#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.

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to