Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Adding <?python ?> support? (was Re: TextMate bundle)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Graham Higgins  
View profile  
 More options Aug 31 2006, 8:08 pm
From: Graham Higgins <gjhigg...@googlemail.com>
Date: Fri, 1 Sep 2006 01:08:26 +0100
Local: Thurs, Aug 31 2006 8:08 pm
Subject: Re: Adding <?python ?> support? (was Re: TextMate bundle)

On 31 Aug 2006, at 23:36, Christopher Lenz wrote:

> In many cases, though, I think using a functional approach in the
> templates is superior to using imperative Python statements in
> processing instructions.

The expressive economy of template functions is well worth  
exploiting, purely to reduce the complexity and to ease maintenance.  
However, I've found that template functions don't help much when  
generating presentation-oriented Javascript which references page  
content - choose your poison, hack presentation logic in the  
controller or use a PI in the template. TG's default kid templates  
currently use the <?python?>PI to check identity, selectively  
rendering a "login" / "logout" link as appropriate - although might  
be a moot point as to whether that should be considered to be  
application logic or presentation logic.

> I think this approach fits quite nicely with templates, and we've
> started collected some functions that are useful in common
> presentation logic:

>    <http://markup.edgewall.org/wiki/HelperFunctions>

Handy, thanks for that.

> But I'm afraid that many people would still find it easier if they
> could just drop into raw Python in the template, which is why I'm
> considering adding support for the <?python ?> PI.

I'm not above hacking templates with application logic --- it doesn't  
prompt a server restart and has proved to be a fluid and useful rapid  
prototyping technique for when I'm experimenting. After the page  
functionality is drafted out, I migrate the application logic into  
the model/controller as appropriate.

Cheers,

Graham.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.