On 10/12/05, Andreas <[EMAIL PROTECTED]> wrote:
> I'd like to do a ITEM_NAME[item.type] lookup. In the example above this
> should return 'name 3'. The obvious thing to do is of course {{
> ITEM_NAMES.item.type }}. However, this doesn't work. Apparently Django
> interprets ITEM_NAMES.item.type as ITEM_NAMES[item].type.
>
> Does something along the lines of ITEM_NAMES.(item.type) or
> ITEM_NAMES..item.type exist?Hey Andreas, Nope, there's intentionally no support for dynamic lookup like that, because we've tried to avoid the slippery slope of turning the template language into a programming language. In your case, pass ITEM_NAMES[item.type] to the template context. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org

