#539 closed defect (fixed)
Support for strides in the slice filter.
| Reported by: | Esaj | Owned by: | Adrian Holovaty | 
|---|---|---|---|
| Component: | Core (Other) | Version: | |
| Severity: | normal | Keywords: | slice strides | 
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
This patch adds support for strides in the slice filter.
For example:
{% my_list|slice:"::2" %}
should include every other element of my_list.
Attachments (2)
Change History (5)
by , 20 years ago
| Attachment: | defaultfilters.py.diff added | 
|---|
comment:1 by , 20 years ago
| Status: | new → assigned | 
|---|
by , 20 years ago
| Attachment: | efficient_slice.patch added | 
|---|
A more efficient implementation of slice supporting strides.
  Note:
 See   TracTickets
 for help on using tickets.
    
We might be able to solve this more efficiently using the
slice()built-in function.