I want to access the object property like this
'region' :obj.region ? obj.region.name : "None"
The thing is in my class i want that if obj.region does not exist then i want none in the region. But if it has region associated then i want the name of the region.
The region is not true false but object
How can do that
As pointed out in the comments:
But I wouldn’t be surprised if it should be:
Depending on exactly what
objis – whether it’s an actual object or a dictionary.