Google App Engine-Ajax refresh from datastore using python

The call to load('/refresh') replaces the contents of the responsecontainer div with the loaded HTML.

{% for greeting in greetings %} 
  {% if greeting.author %} 
    <b>{{ greeting.author.nickname }}</b> wrote: 
    <a href="/sign?key={{ greeting.key.id }}&auth={{ greeting.author.nickname }}">Delete</a> 
  {% else %} 
   An anonymous person wrote: 
  {% endif %} 
  <blockquote>{{ greeting.content|escape }}</blockquote> {% endfor %}
 To avoid duplicating that content in both templates, you could potentially make your main template include this sub-template inside the div, for example:
<div id="responsecontainer"> 
    {% include "sub_template.html" %} </div> 
<form action="/sign" method="post"> <div><textarea name="content" rows="3" cols="60"></textarea></div> <div><input type="submit" value="Sign Guestbook" name="submitGuestBk"></div> </form> 
Best Answer
 

0 comments: