Check if list of objects contain an object with a certain attribute value Check if list of objects contain an object with a certain attribute value python python