Opened 15 years ago
Closed 13 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)
Change History (9)
comment:1 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 14 years ago
Type: | → New feature |
---|
comment:3 by , 14 years ago
Severity: | → Normal |
---|
comment:4 by , 13 years ago
Easy pickings: | unset |
---|---|
Owner: | changed from | to
Status: | new → assigned |
UI/UX: | unset |
by , 13 years ago
Attachment: | renamed_simple_tags.patch added |
---|
by , 13 years ago
Attachment: | renamed_simple_tags.2.patch added |
---|
comment:5 by , 13 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 , 13 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Note:
See TracTickets
for help on using tickets.
It'd also be useful for if you want the simple tag to have a different name than the actual function name.