Tuesday 15 March 2011

access list by index in django template -


I am dynamically trying to use an index state in the list.

{{allAppsList {{App.id}}. Link}}

This is not working.

{{allAppsList.0.link}}

worked.

This should be some grammar issue. I'm online Google, but nothing found useful.

BTW: I want to do this when used in Java.

int index = app.id;

string link = app list [index] .getLink ();

You can not do anything like this in a DJ ango template, but it is also not impossible .

If you are really in this, you can make one. Implementation will be easy, just pass the list and index with your custom filter and do it properly that you will do with java .

Start

No comments:

Post a Comment