I’m trying to find a way to easily loop through a Google App Engine (Python) Model and to print out each property and the property name.
This is how I’m trying it, and after some research I realize I can’t next variables in each other. Is there a way to do this with filters or a way to return all of the values of the properties of a Model?
Thanks
templateargs = {'properties':MyModel.properties(), 'user1':MyModelObj, 'user2':MyModelObj}
{% for property in properties %}
Property: {{property}}
User1: {{user1.{{property}}}}
User2: {{user2.{{property}}}}
{% endfor %}
After some more research I realized the proper way to do this was with gettattr. I used a filter along the lines of:
As suggested here