[Zope3-dev] RFC: abolishing python: expressions in ZPT TALES
Marius Gedminas
mgedmin at b4net.lt
Thu Dec 29 04:40:20 EST 2005
On Wed, Dec 28, 2005 at 12:26:13PM -0330, Rocky Burt wrote:
> Its my personal opinion that anytime a page template requires logic
> complicated enough to warrant using a 'python:' expression, that logic
> should be re-thought and placed into a view class. I know that some
> python: expressions are fairly simple, but for an HTML designer, *any*
> python: portions are dangerous to touch (and shouldn't be touched by the
> HTML designer).
>
> What do you all think?
+0.5
It would make the developers' job harder. I would have to bite the
bullet and write methods for all the little 'python:foo and bar'
snippets (no boolean operations in TALES).
The most difficult part will be to change expressions like
tal:content="python:view.someMethod(arg1, arg2)"
where arg1/arg2 come from nested tal:repeats etc. You would have to
write a view method to wrap the inner objects deep inside lists of lists
of lists.
I think in the end you would get better code, and better page templates.
"Better" here means "more readable, more maintainable, less buggy,
better tested".
Marius Gedminas
--
Professionalism has no place in art, and hacking is art. Software Engineering
might be science; but that's not what I do. I'm a hacker, not an engineer.
-- jwz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20051229/618490b9/attachment.bin
More information about the Zope3-dev
mailing list