Adding the ability to select list items in the context by index. #143
Adding the ability to select list items in the context by index. #143mintchaos wants to merge 2 commits intodefunkt:masterfrom
Conversation
This matches the behavior of JS implementations of mustache. Tested
against mustache.js and Hogan.
>>> context = {"data": ['one', 'two', 'three']}
>>> pystache.render("{{ data.0 }}", context)
'one'
|
Is this a duplicate of issue #134? |
|
@cjerdonek I haven't actually tried the syntax in #134, but I'd imagine that this solves that as well. |
|
I think checkin 316c9d4 to support element cherrypick by index with syntax "{{array_key.index}}" is very important feature for this project. Without this feature, some data could not be rendered from array. If you try http://mustache.github.io/#demo, you could find that javascript library has already supported this syntax. |
|
This has not been added yet? |
|
👍 Very important and interesting feature indeed! |
|
I would like to have this functionality as well. |
|
Hi @cjerdonek can this be merged please? |
|
I too would love to have this merged in. Any chance that this project will be updated ever again? |
|
Any reason why this hasn't been merged? |
|
@cjerdonek is this repo (and this useful PR that it contains) no longer being maintained? |
|
I would like this feature as well. |
|
but also would be nice to access the last element as a function |
This matches the behavior of JS implementations of mustache. Tested
against mustache.js and Hogan.
Tests added and all previous behavior maintained.