Opened 3 years ago

Closed 3 years ago

#33202 closed New feature (wontfix)

Add a "grouper" template filter

Reported by: horpto Owned by: nobody
Component: Template system Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

A simple filter tag that will get an iterableof elements and optional number n. It will regroup an iterable to iterable of lists with length not more than n elements. By default n is 2.
This filter can be used to render lists to rows.

[3,4,5,6,7,8,9]| grouper -> [[3, 4], [5, 6], [7, 8], [9]]

Change History (1)

comment:1 by Mariusz Felisiak, 3 years ago

Resolution: wontfix
Status: newclosed
Version: dev

The current thread is to keep Django a core framework, not providing every utility which might be useful. You can write that filter in your own library. You can start a discussion on DevelopersMailingList if you don't agree.

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