views:

84

answers:

0

I'm trying to iterate through an Expando-Model's dynamic properties in order to output them all. Is there a way of doing this other than creating your own method like such:

class Event(db.Expando):
    platform = db.ReferenceProperty(Platform)
    date = db.DateTimeProperty()

    def getValues(self):
        return self._dynamic_properties

And then in the template - which is passed a 'platform' object:

{% for event in platform.event_set %}
    <b>{{ event.date }}</b><br />
    {% for pair in event.getValues.items %}
        {{ pair.0 }} = {{ pair.1 }}<br />
    {% endfor %}
{% endfor %}

This works, but I'm suprised I can't just do:

{% for event in platform.event_set %}
    <b>{{ event.date }}</b><br />
    {% for pair in event.items %}
        {{ pair.0 }} = {{ pair.1 }}<br />
    {% endfor %}
{% endfor %}

Without having my own method call... should I use something other than '.items'?