Return only unique values in the output of the sort filter#443
Return only unique values in the output of the sort filter#443steelman wants to merge 1 commit intopallets:masterfrom
Conversation
|
|
Re 1: Indeed, I didn't check the details. Re 2: I haven't seen this anywhere in the documentation and I am new to Jinja enough not to know which parts of it are common with Python. Too bad it doesn't work. Re 3: I thought about it. However, I prefered sorted output anyway so I came up with something simmilar to |
|
Re 2: I'm not so sure anymore if that builtin is actually available in Jinja. I think it's not. FWIW you can add your own filters and globals to Jinja, and since Python doesn't have a comparable function, I am not sure if this might not be out of scope -- even if only slightly. You're the first one to request this, so I'd like to just keep this open and see how many people |
|
I'd agree that a built-in way to eliminate duplicates from a sequence would be desirable. In fact, I ended up implementing a |
|
I have just rebased and improved my old patch, and submitted a new pull request, see #469. |
|
I'm not against adding a filter like |
Alternatively a separate
uniqfilter may be developed.