#15338 closed Bug (fixed)
django.utils.decorators isn't documented
Reported by: | Gabriel Hurley | Owned by: | Gabriel Hurley |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | timograham@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
It's certainly not the only thing that's not documented in django.utils, but there are a few useful decorators there. In particular, method_decorator
which is discussed in the CBV docs would be good to document.
Attachments (2)
Change History (13)
comment:1 by , 14 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 14 years ago
Version: | 1.2 → SVN |
---|
Haha, the fact that it's not officially stable by virtue of *omission* from that list would be why grepping it didn't help.
I didn't mean to imply that everything in it should be documented publicly, but at least a couple of them (as you say) have become de facto public APIs.
My new favorite toy is the -n
flag on the sphinx builder which shows warnings for every broken crossref... so I see lots of things that aren't documented now ;-)
comment:3 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
by , 12 years ago
Attachment: | 15338.diff added |
---|
comment:6 by , 12 years ago
Cc: | added |
---|---|
Has patch: | set |
Added a simple patch for method_decorator, would anyone like to weigh in on the usefulness of documenting any of the other functions in decorators?
comment:7 by , 12 years ago
I'd think documenting decorator_from_middleware* would be worth it - they have pretty extensive use in the wild, aren't likely to change, and can be pretty valuable if you found middleware you want to use, but only on some views.
Since decorators already take some degree of head warping, I'm not sure the word "dynamically" adds a lot here:
https://code.djangoproject.com/attachment/ticket/15338/15338.diff#L13
Thanks Tim for the dedication to the docs!
by , 12 years ago
Attachment: | 15338.2.diff added |
---|
comment:8 by , 12 years ago
Thanks for the feedback. I can't take credit for "dynamically" or most of this patch as it's mostly copied from docstrings.
comment:9 by , 12 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Looks good to me. Patch applies cleanly, docs generate. The other functions don't feel nearly as widely-applicable as the ones that are already documented.
comment:10 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Technically, the reason that it's not documented is because it's not officially stable API. However, given that tools like method_decorator are pretty much essential now, we should probably formalize the contents of utils.decorators.