How to format output of methods inside of a class in an efficient way?
<p>I want to write a class with much stuff inside. Right now I want to have <strong>certain options for the output to show data in a disired format</strong>. Im my example a function inside a class should format the output (a former dictionary) as a list. But i really can't figure out how to do it...</p>

<p>here my try:</p>

<pre><code>class TestClass(object):
    def __init__(self):
        pass

    def return_values_as_list(self,otherfunction):
        data_as_list=[ i for i in otherfunction.values()]
        return data_as_list

    def get_data1_from_db(self):
        self.data= {'1_testkey':'1_testvalue',"1_testkey2":"1_testvalue2"}

    def get_data2_from_db(self):
        self.data= {'2_testkey':'2_testvalue',"2_testkey2":"2_testvalue2"}
        return self.data 
</code></pre>

<p>What i want to have at the end is something like </p>

<blockquote>
  <p>['1_testvalue','1_testvalue2']</p>
</blockquote>

<p>when  instantiation looks like the following:</p>

<pre><code>testcase = TestClass()
testcase.get_data1_from_db.return_values_as_list()
</code></pre>

<p>Any help with that? I thought also of hooks...but i dont really know how to do that...</p>
