As the title says, I am being returned deadlocks waiting for future wheneve
I use the iter() method.
Example:
imagenes_keys = memcache.get('imagenes_keys_inmueble-referencia=%s' %
inmueble.referencia)
if not imagenes_keys:
q_img = Imagen.query(ancestor = inmueble.key).order(Imagen.fecha)
imagenes_keys = q_img.iter(keys_only = True)
memcache.set('imagenes_keys_inmueble-referencia=%s' % inmueble.
referencia, imagenes_keys)
I am invoking imagenes_keys as a loop inside a Jinja2 template. I.e.,
{% for img_key in imagenes_keys %}
<li><img src="/imagen/{{img_key}}" alt="Image" width="480" height="360"></li
>
{% endfor %}
Same happens, regardless of query options, everytime I have used iter() in
NDB.
There is a workaround which seems to solve the problem for now,
imagenes_keys = memcache.get('imagenes_keys_inmueble-referencia=%s' %
inmueble.referencia)
if not imagenes_keys:
q_img = Imagen.query(ancestor = inmueble.key).order(Imagen.fecha)
imagenes_keys = q_img.iter(keys_only = True)
if imagenes_keys:
imagenes_keys = list(imagenes_keys)
memcache.set('imagenes_keys_inmueble-referencia=%s' % inmueble.
referencia, imagenes_keys)
I understand iter() is returning somehow a future object instead of an
iterator object itself.
I have researched the documentation but found no answer. Is there something
I do not know yet about NDB's iter() -which I prefer to use, more so
because I understand is the recommended method over fetch()- or there is a
problem with calling the iterator from Jinja2?
Thank you in advance
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.