In your handler, pass:

    zip(entity.images, entity.snippets)

...to your template. Let's say the template variable is called
"items". Then in the template you can do:

{% for image, snippet in items %}
    Do something with {{ image }} and {{ snippet }}.
{% endfor %)

Above will work in Django 1.0. If you use the built-in Django 0.96,
use this instead:

{% for item in items %}
    Do something with {{ item.0 }} and {{ item.1 }}.
{% endfor %)


On Dec 10, 5:38 pm, Dylan Lorimer <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Perhaps this is more of a design issue than anything, but here's the
> dilemma I'm up against:
>
> I have a model class that has 2 GAE StringList properties,'images' and
> 'snippets'. 'images' contains a list of URLs pointing to images, and
> snippets has corresponding image descriptions.
>
> For clarity's sake, snippets[0] goes with images[0].
>
> I can't for the life of me figure out how to iterate through both
> images and snippets in a Django template to output the image URL +
> associated snippet.
>
> Any ideas? I'd be up for a better way to store both image URLs +
> snippets if that made the most sense, but I don't see a better way.
> Ideally I could store a dictionary but the GAE doesn't support
> dictionaries as database types, right?
>
> Your help is kindly appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to