@register_tag<EOL>def call(obj, method, *args, **kwargs):
function_or_dict_or_member = getattr(obj, method)<EOL>if callable(function_or_dict_or_member):<EOL><INDENT>return function_or_dict_or_member(*args, **kwargs)<EOL><DEDENT>if not len(args):<EOL><INDENT>return function_or_dict_or_member<EOL><DEDENT>return function_or_dict_or_member[args[<NUM_LIT:0>]]<EOL>
Allows to call any method of any object with parameters.

Because come on! It's bloody stupid that Django's templating engine doesn't
allow that.

Usage::

    {% call myobj 'mymethod' myvar foobar=myvar2 as result %}
    {% call myobj 'mydict' 'mykey' as result %}
    {% call myobj 'myattribute' as result %}

:param obj: The object which has the method that you would like to call
:param method: A string representing the attribute on the object that
  should be called.