Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#23260 closed Bug (fixed)

unordered_list filter doesn't work with generators

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

Description (last modified by Jaap Roes)

Using the unorderd_list template filter on a generator raises
TypeError: object of type 'generator' has no len()

Created a pull request:
https://github.com/django/django/pull/3034

Change History (8)

comment:1 by Jaap Roes, 10 years ago

Description: modified (diff)
Has patch: set
Owner: changed from nobody to Jaap Roes
Status: newassigned

comment:2 by Jaap Roes, 10 years ago

Description: modified (diff)

comment:3 by Tim Graham, 10 years ago

Triage Stage: UnreviewedAccepted

comment:4 by Tim Graham, 10 years ago

Patch needs improvement: set

There are some test failures on Python 3.

comment:5 by Jaap Roes, 10 years ago

Patch needs improvement: unset

Forgot to test in Python 3, pushed a new patch that fixes the tests.

comment:6 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In b3660d28f3422a33a84de7a7ccad404b3135a1a8:

Fixed #23260: Added generator support to defaultfilters.unordered_list.

comment:7 by Tim Graham <timograham@…>, 7 years ago

In b21b1b10:

Refs #23260 -- Tested nested generator input to unordered_list template filter.

comment:8 by Tim Graham <timograham@…>, 7 years ago

In 673427d3:

[2.0.x] Refs #23260 -- Tested nested generator input to unordered_list template filter.

Backport of b21b1b10af0bbe0498193881520efb02897bd444 from master

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