2008/5/1 Christoph Zwerschke <[EMAIL PROTECTED]>:

> > I would like to do some thing like the following in my kid template:
> > <?python
> >   back   = 'Terug'
> >   create = 'Nieuwe'
> >   edit   = 'Aanpassen'
> >   if( tableName == 'Owner' ):
> >     recordType = 'Eigenaar'
> >   if( page == 'new' ):
> >     title = '%s %s' % (create, recordType)
> >   elif( page == 'edit' ):
> >     title = '%s %s' % (edit, recordType)
> > ?>
> >
> > But I can not use tableName and page here. In the template itself I can
> use
> > ${tableName} and ${page}. Is there a way to access those values in the
> > <?python part of the template?
>
> You probably need to move the <?python block ?> somewhere inside the
> <html> tag in order to access these. See here:
>
> http://kid-templating.org/language.html#embedding-code-blocks-python


That works like a charm. Thanks.


By the way, you don't need brackets in if statements in Python...


I know, but because of the other languages I work with, I am used to them.
But maybe it is better to start dropping them. For example you can not use
them with a for loop.

-- 
Cecil Westerhof

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to