Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#959 closed defect (invalid)

[patch]Template improvements

Reported by: rjwittams Owned by: Adrian Holovaty
Component: Template system Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

  • Multiple args for filters,comma separated including varargs . Changed removetags filter to use it and put the old version in old_filters template library for people who do not want to fix all thier templates. You can load it in templates, or use template.add_to_builtins('django.template_tags.old_filters') in your settings file to apply it universally. Are there any other filters that should use it?
  • Integers and float literals in resolve_variable . I didn't know what the this should mean for 'add' and the like, so left as is.
  • Fixed standalone template tests to work with the testapp - so all tests pass in all situations.
  • Added a 'lookup' filter, useful now vars work in templates. {{my_dict|lookup:my_index}} for example - a common mailing list request.


Attachments (2)

filters-multi-args.patch (14.1 KB ) - added by rjwittams 19 years ago.
filters-multi-args.diff (14.3 KB ) - added by rjwittams 19 years ago.
update

Download all attachments as: .zip

Change History (7)

by rjwittams, 19 years ago

Attachment: filters-multi-args.patch added

comment:1 by rjwittams, 19 years ago

I messed around with formatfilesize as well. Not sure about that bit to be honest.

by rjwittams, 19 years ago

Attachment: filters-multi-args.diff added

update

comment:2 by rjwittams, 19 years ago

Removetags will now work either way, so no need for old_filters.

comment:3 by rjwittams, 19 years ago

Component: Admin interfaceTemplate system

comment:4 by Adrian Holovaty, 19 years ago

(In [1690]) Changed resolve_variable to resolve integers and floats as integers and floats. Added ifequal unit tests. Refs #959

comment:5 by Jacob, 19 years ago

Resolution: invalid
Status: newclosed

This is too much of a laundry-list for a single ticket (and I suspect that some of this stuff is different at this point). Please re-open individual tickets if any still apply.

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