[ovs-discuss] ovsdb python library .. accessing row elements using a variable as the key

Ben Pfaff blp at nicira.com
Thu Jul 9 17:24:56 UTC 2015


On Thu, Jul 09, 2015 at 03:19:55AM -0700, Mir Ali wrote:
> Hi,
> How can I access a particular column from the row if the column attribute is a variable.
> 
> For example, in a Bridge table I can access the name of the bridge using 'row.name'. I want to do the same but using the column name as a variable. If I can do something as row['name'] it will help me a lot. So far all the methods I tried failed.
> 
> row._data['name'] doesn't work either.

They're attributes, so presumably you can use Python techniques for
accessing attributes, like the getattr function.



More information about the discuss mailing list