#28416 closed Cleanup/optimization (worksforme)
Doc improvement: "divisibleby" DTL filter
Reported by: | Mike Morris | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.11 |
Severity: | Normal | Keywords: | divisibleby, template, filter |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | yes |
Description
This is trivial, but the docs are so excellent, I thought I'd chime in....
https://docs.djangoproject.com/en/1.11/ref/templates/builtins/#divisibleby
states that, "Returns True if the value is divisible by the argument."
Technically of course, the above is always true unless the argument is 0.
You meant "...if the value is integrally divisible by the argument."
Thanks for great docs to a great product!
Change History (2)
comment:1 by , 7 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:2 by , 7 years ago
As a former math major, I can confirm that "divisible by" always refers to the non-trivial case of integer division (or similar non-trivial cases). I also don't think changing the wording to "integrally" necessary makes it any clearer.
I don't see much advantage to changing the wording. I'm not a mathematician but my understanding after doing a quick search is that "divisible by" is short for "divisible equally and integrally".
{{ 3|divisibleby:'0' }}
raises aZeroDivisionError
exception anyway.