Opened 9 months ago

Last modified 9 months ago

#27865 assigned Cleanup/optimization

Document use of Manager rather than BaseManager for from_queryset()

Reported by: Jonatas CD Owned by: Jonatas CD
Component: Documentation Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Following #26953, document the use of Manager rather that BaseManager on 1.9+ to avoid crash with AssertionError.

Currently the example [1] uses BaseManager while in the preceding paragraph is Manager.
[1] https://docs.djangoproject.com/en/dev/topics/db/managers/#from-queryset

Change History (6)

comment:1 Changed 9 months ago by Tim Graham

Easy pickings: unset

A BaseManager is defined in that example that's different from django.db.models.manager.BaseManager. Does the example not work as written?

comment:2 Changed 9 months ago by Jonatas CD

My idea was to keep the example to text - specially after that mentioned ticket.

comment:3 Changed 9 months ago by Tim Graham

I'm not sure what you mean by "keep the example to text". django.db.models.manager.BaseManager isn't a documented API, so I don't see the reason why we'd need a note saying not to use something that's not documented. Anyway, will you propose a patch?

comment:4 Changed 9 months ago by Jonatas CD

sure. I'll do it

comment:5 Changed 9 months ago by Jonatas CD

Owner: changed from nobody to Jonatas CD
Status: newassigned

comment:6 Changed 9 months ago by Tim Graham

Triage Stage: UnreviewedSomeday/Maybe
Note: See TracTickets for help on using tickets.
Back to Top