Opened 16 months ago

Closed 16 months ago

Last modified 16 months ago

#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 Changed 16 months ago by Tim Graham

Resolution: worksforme
Status: newclosed

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 a ZeroDivisionError exception anyway.

comment:2 Changed 16 months ago by Marten Kenbeek

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.

Note: See TracTickets for help on using tickets.
Back to Top