Opened 15 years ago

Closed 14 years ago

#12847 closed New feature (fixed)

Allow simple_tags to specify a function name

Reported by: David Cramer Owned by: Vladimir Moskva
Component: Template system Version: 1.1
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It would be useful if simple_tag allowed you to specify the function name.

e.g.

register.simple_tag(lambda x: x-1, 'minusone')

Attachments (2)

renamed_simple_tags.patch (3.0 KB ) - added by Vladimir Moskva 14 years ago.
renamed_simple_tags.2.patch (4.2 KB ) - added by Vladimir Moskva 14 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by Chris Beaven, 15 years ago

Triage Stage: UnreviewedAccepted

It'd also be useful for if you want the simple tag to have a different name than the actual function name.

comment:2 by Luke Plant, 14 years ago

Type: New feature

comment:3 by Luke Plant, 14 years ago

Severity: Normal

comment:4 by Vladimir Moskva, 14 years ago

Easy pickings: unset
Owner: changed from nobody to Vladimir Moskva
Status: newassigned
UI/UX: unset

by Vladimir Moskva, 14 years ago

Attachment: renamed_simple_tags.patch added

by Vladimir Moskva, 14 years ago

Attachment: renamed_simple_tags.2.patch added

comment:5 by Vladimir Moskva, 14 years ago

Has patch: set

There is already one optional keyword argument (takes_context=None), so it was reasonable to make a keyword argument name="new_name".

Tests and docs are included in the second patch.

comment:6 by Jannis Leidel, 14 years ago

Triage Stage: AcceptedReady for checkin

comment:7 by Jannis Leidel, 14 years ago

Resolution: fixed
Status: assignedclosed

In [16373]:

Fixed #12847 -- Added name parameter to simple_tag, assignment_tag and inclusion_tag helpers. Thanks, vladmos.

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