#23260 closed Bug (fixed)

unordered_list filter doesn't work with generators

Reported by: jaap3 Owned by: jaap3
Component: Template system Version: master
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 jaap3)

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 (6)

comment:1 Changed 11 months ago by jaap3

  • Description modified (diff)
  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to jaap3
  • Patch needs improvement unset
  • Status changed from new to assigned

comment:2 Changed 11 months ago by jaap3

  • Description modified (diff)

comment:3 Changed 11 months ago by timgraham

  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 11 months ago by timgraham

  • Patch needs improvement set

There are some test failures on Python 3.

comment:5 Changed 11 months ago by jaap3

  • Patch needs improvement unset

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

comment:6 Changed 11 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In b3660d28f3422a33a84de7a7ccad404b3135a1a8:

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

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