Hi,

We use Django templates from 0.96 with the webapp framework:
http://www.djangoproject.com/documentation/0.96/templates/

-Marzia

On Wed, Feb 18, 2009 at 8:52 AM, arnie <[email protected]> wrote:

>
> while searching I find that using BaseRequestHandler's generate method
> [self.generate] we can create html files but i still not able to get
> the syntax of the code [leaving plain html aside] that is being used
> in these. For example the below given code will create the edit.html
> page
>
> ******************************************************
>
> class EditHandler(BaseRequestHandler):
>  """When we receive an HTTP Get request to edit pages, we pull that
>     page from the datastore and allow the user to edit.  If the page
> does
>     not exist we pass empty arguments to the template and the
> template
>     allows the user to create the page
>  """
>
>  def get(self, page_title):
>    # A user must be signed in to edit the page
>    current_user = users.get_current_user()
>
>    if not current_user:
>      self.redirect(users.create_login_url(self.request.path))
>
>    # Display the existing body if it exists
>    entry = WikiPage.gql('WHERE title = :1', page_title).get()
>
>    self.generate('edit.html', template_values={'page_title':
> page_title,
>                                                'entry': entry})
>
> *******************************************************
> but in edit.html with code as given below
> **************************************************
> {% extends "base.html" %}
> {% block title %}Editing: {{ page_title }}{% endblock %}
> {% block content %}
>    <h1>Editing: {{ page_title }}</h1>
>    <form action="/save/{{ page_title }}" method="POST">
>        <textarea rows="20" cols="80" name="body" id="body">
> {{ entry.body }}</textarea><br/>
>        <input type="submit" value="Save Changes"/>
>    </form>
> {% endblock %}
> ***************************************************
> here what the code snippet
> {% block title %}Editing: {{ page_title }}{% endblock %}
> {% block content %}
> says all about.
> Even though I will create html files as usual but it seems to me that
> I need to understand the above given syntax also in order to use these
> html files in GAE
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to