#23376 closed Cleanup/optimization (fixed)
Inconsistent documentation about required Storage methods
Reported by: | Jaap Roes | Owned by: | James Brewer |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | custom storage documentation, afraid-to-commit |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
https://docs.djangoproject.com/en/dev/howto/custom-file-storage/ mentions the following:
[...] but you must implement the following methods:
- Storage.delete()
- Storage.exists()
- Storage.listdir()
- Storage.size()
- Storage.url()
Yet https://docs.djangoproject.com/en/dev/ref/files/storage/#the-storage-class says that delete
, listdir
, size
and url
may raise NotImplementedError
. Which is it?
Change History (11)
comment:1 Changed 9 years ago by
Easy pickings: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Bug → Cleanup/optimization |
comment:2 Changed 9 years ago by
Keywords: | afraid-to-commit added |
---|
I've marked this ticket as especially suitable for people following the Don't be afraid to commit tutorial at the DjangoCon US 2014 sprints. If you're tackling this ticket, please don't hesitate to ask me for guidance if you'd like any, either at the sprints themselves, or here or on the Django IRC channels, where I can be found as EvilDMP.
comment:3 Changed 9 years ago by
I would love to contribute to this as a beginner. I am not able to attend the sprints but I would love the feedback.
comment:4 Changed 9 years ago by
Owner: | changed from nobody to Johnny Hung |
---|---|
Status: | new → assigned |
comment:5 Changed 9 years ago by
Has patch: | set |
---|---|
Patch needs improvement: | set |
I think it would be good to add details about things that might break if you don't implement each method.
comment:6 Changed 9 years ago by
I've marked this ticket as especially suitable for people following the Don't be afraid to commit tutorial at the PyCon Ireland 2014 sprints. If you're tackling this ticket, please don't hesitate to ask me for guidance if you'd like any, either here or on the Django IRC channels, where I can be found as EvilDMP.
comment:7 Changed 9 years ago by
Owner: | changed from Johnny Hung to James Brewer |
---|
comment:8 Changed 9 years ago by
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Patch looks good to me.
comment:9 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Hi,
Indeed, this appears to be inconsistent.
A quick look at the history of the files seem to indicate that the "topic"-style documentation is older than the reference documentation so it might have gotten out of sync.
I'm not familiar with the storage API but it seems that
must
could be replaced byshould
here.Thanks.