Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#15732 closed Cleanup/optimization (fixed)

stringfilter documentation example does not work

Reported by: Antti Kaihola Owned by: nobody
Component: Documentation Version: dev
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: no

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 13 years ago.
Adds the missing @register.filter decorator to the @stringfilter example
15732_stringfilter_docs.diff (1.8 KB ) - added by hahasee 13 years ago.

Download all attachments as: .zip

Change History (7)

by Antti Kaihola, 13 years ago

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

comment:1 by Gabriel Hurley, 13 years ago

Keywords: easy-pickings added
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 by Jacob, 13 years ago

Easy pickings: set

comment:3 by hahasee, 13 years ago

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.

by hahasee, 13 years ago

comment:4 by Chris Beaven, 13 years ago

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 by Chris Beaven, 13 years ago

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