Dict key as function in a class
<p>How do I call the get_productname function from the dictionary in the code below?</p>

<pre><code>test = {
       'get_productname' : {
                         'id' : 1,
                         'active' : 1,
                         }
    }

class search(object):
    def __init__(self):
        for key, value in test.items():
            if test[key]['active']:
                ... here i want to call the "get_productname" function from the dict key name
                self.key()
                ... HOW CAN I DO THIS?

    def get_productname(self, id):
        ...
        return productname 
</code></pre>
