#20768: Create a reference of public Manager methods -------------------------------+------------------------------------ Reporter: ramiro | Owner: nobody Type: New feature | Status: new Component: Documentation | Version: master Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------+------------------------------------
Comment (by loic84): IMO `ref/models/managers.txt` should take over a fair chunk from the topic guide `topics/db/managers.txt`. The reference would include the stock `Manager` methods and attributes and everything one needs to know about '''using''' managers (either the stock `Manager` or subclasses like `CurrentSiteManager`). I suggest the following: - A section about `QuerySet` methods. I'm not sure if we should list them all or just mention that all `QuerySet` public methods but `delete()` are available from `Manager`. - Reference the `from_queryset()`, `get_queryset()`, `raw()` methods and the `model`, `db`, `use_for_related_fields` attributes. - Get "Manager names" from the topic guide. - Split "Modifying initial Manager QuerySets" from the topic guide into two parts, one that goes within the `get_queryset()` definition and the other one into a new section "Using multiple managers on the same model". - Get "Custom managers and model inheritance" from the topic guide. The topic guide would then stick to the ins and outs of creating a custom Manager: - "Calling custom QuerySet methods from the Manager" - "Creating Manager with QuerySet methods" (linked from `Manager.from_queryset` and `QuerySet.as_manager`) - A new section about creating a `Manager` by compositing `QuerySets` like the example in https://github.com/django/django/pull/1328#issuecomment-21439470 - "Implementation concerns" - "Controlling automatic Manager types" (Linked from `Manager.use_for_related_fields`) - "Writing correct Managers for use in automatic Manager instances" (Linked from `Manager.use_for_related_fields`) While we are at it, we should remove the Male/Female distinction from the examples. Feedback welcome. -- Ticket URL: <https://code.djangoproject.com/ticket/20768#comment:3> 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 post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.ab9250a1fd7c155aec26e5c17b4bf7a9%40djangoproject.com. For more options, visit https://groups.google.com/groups/opt_out.