1 comments:

  1. Couldn't get the selectattr example to work

    {% for route in routes|selectattr('mode','equalto','backup')|map('combine', { 'distance': '150' }) + routes|selectattr('mode','equalto','nominal')|map('combine', { 'distance': '10' })......

    Kept giving "unsupported operand type(s) for +: 'generator' and 'generator'" error

    Replies
    1. Based on your error message, I'm suspecting you need a list after the map (map(...)|list) to convert a generator into a list.

      Not sure whether something changed in the meantime or whether it's a bug in the original document.

Add comment
Sidebar