I want to dynamically list all available properties from an odata Entity using PyOData package.
Here is what I'd like to do:
service = pyodata.Client(SERVICE_URL, session)
positions = service.entity_sets.TRLPositionSet.get_entities().select('Prop1,Prop2').execute()
for p in positions:
# how to implement get_properties below?
properties = get_properties(p)
for prop in properties:
print(prop.name, getattr(p, prop.name)
How would I implement the get_properties(p)
function to make it return a list ['Prop1', 'Prop2']
?