Alex,
Django really doesn't care if it's a query object or not. As long as
it's a valid iterator, the {% for %} tag will work.
However, if your query returns a lot of entities, it will be more
efficient to prefetch them with fetch(). Iteration retrieves the
entities in batches, if the batch size is less than the number of
entities the query returns - you will have multiple roundtrips to the
datastore.
HTH,
Alex
--
www.muspy.com
On Oct 23, 5:52 am, Alex Vartan <[EMAIL PROTECTED]> wrote:
> Hi,
>
> This is a newbie-ish sort of question, but I've got an entity that
> includes an implicitly defined collection:
>
> Person.contact_set
>
> as my Contact object has a ReferenceProperty that refers to the Person
> entity.
>
> I know from the tutorials that contact_set is a query object and thus
> requires a fetch, unless it is used as an iterator. My question is,
> can I use the Django templat {%for...} construct to access
> Person.contact_set in the template, or do I need to do a fetch in my
> python code and assign the results in the dictionary of key-value
> pairs passed as template_data?
>
> Thanks. This could be a bit more clear in the docs unless I missed
> something.
> Alex
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---