Python Object from a SQL row (with a large number of columns)
<p>Given the following SQL query, </p>

<pre><code>    cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=localhost;DATABASE=testdb;UID=me;PWD=pass')
    cursor = cnxn.cursor()
cursor.execute("select field1, field2, field3, fieldA, fieldB, fieldB from users")
    row = cursor.fetchone()
</code></pre>

<p>I would like to pass the row object as an argument in creating a new object, e.g.</p>

<pre><code>A = CertainTypeOfApple(row)
</code></pre>

<p>In the <code>__init__(self,row)</code> of class CertainTypeOfApple, I would like to transform each of the fields, i.e. field1, field2,..., to object attributes. Is there some straighforward way to do that? In other words, I would like to do this in a more compact way:</p>

<pre><code>self.field1 = row.field1
self.field2 = row.field2
...
</code></pre>
