durusmail: quixote-users: DOMish view of HTML as it's being rendered
ZODB FileStorage problem
2002-02-27
2002-02-28
2002-02-28
2002-03-01
DOMish view of HTML as it's being rendered
2002-02-28
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
DOMish view of HTML as it's being rendered
Greg Ward
2002-03-01
On 28 February 2002, Quinn Dunkan said:
> It's easy to apply ad hoc solutions for something like that.  I have many
> templates that look like:
[...code skipped...]
> i.e. all the usual python tricks.  It often seems clearer to have all the
> fancy formatting stuff up above and render the page in bigger chunks.

That's a principle I've arrived at too.  Another way of putting it:
although PTL makes it easier to intermingle logic and rendering,
separating them is still a good idea.  Sometimes all it takes to
separate them is for the first 10 lines of a template to be straight
Python string-fiddling and loops and conditionals, and the last 10 a
block of HTML text with simple variable substitutions.  When those 10
line blocks become 40 lines, it's then really easy to factor the logic
out into a function.

        Greg
--
Greg Ward - software developer                gward@mems-exchange.org
MEMS Exchange                            http://www.mems-exchange.org


reply