class MethodProxy(object):
    """For consolidating into 1 method the calling of methods with various single args
      (suitable dictionary keys)
      class MyModel(models.Model):
          ...
          def magic(self, value):
          def thing(self):
              return MethodProxy(self.magic)
      >>> m = MyModel()
      ...
      >>> m.thing['value'] == m.magic('value')
      {{ m.thing.value }}
      """

def __init__(self, method):
    self.method = method

def __getitem__(self, key):
    pass
система шаблонов django, вызов функции внутри модели