Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#15732 closed Cleanup/optimization (fixed)

stringfilter documentation example does not work

Reported by: Antti Kaihola Owned by: nobody
Component: Documentation Version: master
Severity: Normal Keywords: easy-pickings
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX:

Description

In stringfilter decorator documentation, the first code example given does not work because @register.filter is missing.

Attachments (2)

15732_stringfilter_doc_example_r15965.diff (457 bytes) - added by Antti Kaihola 5 years ago.
Adds the missing @register.filter decorator to the @stringfilter example
15732_stringfilter_docs.diff (1.8 KB) - added by hahasee 5 years ago.

Download all attachments as: .zip

Change History (7)

Changed 5 years ago by Antti Kaihola

Adds the missing @register.filter decorator to the @stringfilter example

comment:1 Changed 5 years ago by Gabriel Hurley

Keywords: easy-pickings added
Needs documentation: unset
Needs tests: unset
Patch needs improvement: set
Triage Stage: UnreviewedAccepted
Type: BugCleanup/optimization

Changing the docs as suggested won't work because we haven't been introduced to registering filters yet (and we'd have to add that line to all of the preceding examples). Instead, flipping the sections on "Registering custom filters" and "Template filters that expect strings" would make far more sense. That way the flow of information goes from writing filters to registering them to other useful information about them.

comment:2 Changed 5 years ago by Jacob

Easy pickings: set

comment:3 Changed 5 years ago by hahasee

I switched the sections and made the stringfilter example work. I wasn't sure if this was the place for a full example with all the includes, but wasn't sure what else to do.

Changed 5 years ago by hahasee

comment:4 Changed 5 years ago by Chris Beaven

Resolution: fixed
Status: newclosed

In [16251]:

Fixes #15732 -- better introduction of template filter decorator concepts (first register, then stringfilter). Thanks for the patch, hahasee.

comment:5 Changed 5 years ago by Chris Beaven

Patch needs improvement: unset

I removed @stringfilter from the register doc examples too, so we're introducing one concept at a time.

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