#27106: Document which template filters can be used in Python code (and how)
-------------------------------------+-------------------------------------
Reporter: Baptiste Mispelon | Owner: Ryan
Type: | Cheley
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Ryan Cheley):
Replying to [comment:11 Baptiste Mispelon]:
> The `truncatechars` filter linked in the original ticket still doesn't
document which utility function it uses under the hood. Based on that, I
would say that the ticket is still valid.
>
> Reading comment:1 and comment:2, it seems the direction of the ticket is
to:
>
> 1) identify the utility functions that are used by the default template
filters
> 2) make sure those utilities are documented (on their respective pages)
> 3) make sure the template filter documentation links to the
corresponding utils documentation
For `truncatechars` would something like this be what is needed (it would
need to be cleaned up to conform to the standards in the docs, but I just
want to make sure I’m on the right track)
`truncatechars` when given a non-HTML string uses `unicodedata.normalize`
documented here
https://docs.python.org/3/library/unicodedata.html#unicodedata.normalize
`truncatechars` when given an HTML string uses `HTMLParse` from
`html.parser` which is documented here
https://docs.python.org/3/library/html.parser.html
--
Ticket URL: <https://code.djangoproject.com/ticket/27106#comment:12>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018f0146c9c1-d88ddd35-87a9-4318-ab13-027dbee16a38-000000%40eu-central-1.amazonses.com.