Re: Django template IndexError

2011-09-21 Thread Martin Tiršel
It seems, that Django handles methods and variables indexes differently. So I solved it this way: e = IndexError() e.silent_variable_failure = True raise e Martin On Wed, 21 Sep 2011 23:36:58 +0200, Martin Tiršel wrote: Hello, I have this situation: class SomeClass(object): ...

Django template IndexError

2011-09-21 Thread Martin Tiršel
Hello, I have this situation: class SomeClass(object): ... def __getitem__(self, key): ... raise IndexError() and now: context['somevar'] = {'one': 1, } context['anothervar'] = SomeClass() in template: {{ somevar.one }} - prints 1 {{ somevar.two }} - prints nothing,