Object comparation in dropdown

Hi! What am I missing here?

Here is some code in a dropdown component at onActionPerformed event:

	itemValido = False

	for item in self.props.options:		
		if item.value == self.props.value:
			itemValido = True
			break

I’m using this to check if the user is creating a new item (The option allowCustomOptions is true in the dropdown)

When I use integer values in the dropdown.props.options, its works fine. like this:

[
  {
    "label": "Excel",
    "value": 1
  },
  {
    "label": "Pacote Office",
    "value": 2
  }
]

But when I use object values, it’s doesn’t work:

[
  {
    "label": "Excel - Básico",
    "value": {
      "value": 1,
      "nivel": 1
    }
  },
  {
    "label": "Excel - Intermeadiário",
    "value": {
      "value": 1,
      "nivel": 2
    }
  }
]

The variable itemValido never becomes true

Many objects use the default equality implementation, which effectively means “is this the same object” and doesn’t recurse into the contents of the object. You’ll have to do the inner comparisons yourself in such cases.

That is sad news…

Because the idea its to make a flexible component. I don’t know the inner structure of the ‘value’.
The idea its to use this component in many cases and each case use a diferent ‘value’ object structure…

Is there a generic way to iterate inside the object structure to make the inner comparisons?