Quantcast
Channel: Django template - dynamic variable name - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by Adem Öztaş for Django template - dynamic variable name

You can try like this, {{ dict|key:key_name }}Filter:def key(d, key_name): return d[key_name]key = register.filter('key', key)More information, django ticket

View Article



Answer by Joe for Django template - dynamic variable name

You're best off writing your own custom template tag for that. It's not difficult to do, and normal for this kind of situation.I have not tested this, but something along these lines should work....

View Article

Django template - dynamic variable name

Good Afternoon,How can I use a variable variable name in Django templates?I have a custom auth system using context, has_perm checks to see if the user has access to the specified section.deptauth is a...

View Article
Browsing latest articles
Browse All 3 View Live




Latest Images