Hi,

For App Engine, my usual strategy is to def
BaseRequestHandler(webapp.RequestHandler) which generates this information,
and then to have each web request handler inherit from BaseRequestHandler.

On the templating side, you can also define a base.html template which
render those links, and then have page templates that extend base.html.

Both of these things are demonstrated in (the very basic)
http://code.google.com/p/google-app-engine-codelab/

-Marzia

On Sun, Dec 28, 2008 at 5:27 AM, JpMaxMan <jpmax...@gmail.com> wrote:

>
> Greetings!  Am spending some time over the holidays familiarizing
> myself w/ the appengine.  Am new to python and to the webapp
> framework.  I have my app pretty much working, but am trying now to
> optimize it.
>
> I am writing an app that maintains the username w/ a login / logout
> link in the upper right corner.  These are loaded and passed to the
> template via the template_values dictionary.  Right now I am loading
> those at the top of each class associated w/ the various pages on the
> site.  I'd like to not re-write so much code, is there a way to set
> these template values globally so I can reference / extend them in
> each class as necessary?
>
>                        url = users.create_logout_url(self.request.uri)
>                        url_linktext = 'Logout'
>                        username = users.get_current_user()
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to