Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#959 closed defect (invalid)

[patch]Template improvements

Reported by: rjwittams Owned by: adrian
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: UI/UX:

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 8 years ago.
filters-multi-args.diff (14.3 KB) - added by rjwittams 8 years ago.
update

Download all attachments as: .zip

Change History (7)

Changed 8 years ago by rjwittams

comment:1 Changed 8 years ago by rjwittams

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

Changed 8 years ago by rjwittams

update

comment:2 Changed 8 years ago by rjwittams

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

comment:3 Changed 8 years ago by rjwittams

  • Component changed from Admin interface to Template system

comment:4 Changed 8 years ago by adrian

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

comment:5 Changed 8 years ago by jacob

  • Resolution set to invalid
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.