#14905 closed (fixed)
models.FileField links to url attribute, which is undocumented.
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Keywords: | filefield url easy-pickings | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
As part of the documentation callout on FileField.storage
found in the Model Field Types documentation here, reference is made to the FileField.url
attribute, which links to the documentation on the File class itself, where it is decidedly absent.
Following the rabbit hole from the original note on the modelfields through the Managing Files documentation, and on to the how-to on writing a custom storage backend (where a note is made that any custom solution must implement the url()
method) we finally end up at the Storage API which does discuss the method.
It's a convoluted process, and I think the ref documentation on File should either document the attribute, or the model FileField reference should link to the documentation for the Storage API itself.
I can attempt to work up a documentation patch if the ticket has merit.
Attachments (1)
Change History (6)
comment:1 by , 14 years ago
milestone: | → 1.3 |
---|---|
Triage Stage: | Unreviewed → Accepted |
by , 14 years ago
Attachment: | django-documentation-14990.diff added |
---|
documentation changes, svn diff against revision 14990
comment:2 by , 14 years ago
Has patch: | set |
---|---|
Keywords: | easy-pickings added |
I've attempted a documentation patch, although I'm still not sure it's correct — all three cannot be mis-linked, as far as I can tell, because there's no documentation on the name attribute on Storage implementations. For better or worse then, I've left the name attribute pointing at django.core.files.File
, and updated the others, adding the caveat that it's up to the Storage class in use to implement them.
I'm adding it as easy-pickings, because even if the current patch isn't workable, it shouldn't be hard for someone perhaps wiser in the file/storage internals to improve.
comment:3 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
The answer is much simpler here: all three of those attributes are mis-linked. They should reference
django.core.files.storage.Storage
instead ofdjango.core.files.File
.There was recently a ticket that pointed out that
url
wasn't an attribute ondjango.core.files.File
at all, and the docs were subsequently reworked to remove the reference from the File API page.What surprises me is that the crossref link to that anchor on the page still resolved itself somehow. Whoever commits a fix for this, please build the docs locally to make sure links to
django.core.files.File.url
no longer resolve. I'm hoping it was just a bit of bad caching that kept the link there this time.