Brian Lloyd wrote: <snip id is sometimes a method (not always though ;-)>
This is one of the things on my List Of Evil Things that should be changed one day in Zope3K :)
<RANT type="angry,frustrated"> How about the nasty hacky mess that is DTML? Some priceless artifacts that need to go: <dtml-var "someMethod(_, _.None, myparam)"> <dtml-call "REQUEST.set('keyname','value')"> <dtml-let x="'hello out there'"> <dtml-var "_[REQUEST['myDoc']]">What is this supposed to do?! <dtml-var "PARENTS[-1].folder.getitem(_.getitem('id',1))"> Not to mention the horribleness that is <dtml-in> and <dtml-with>. There's dtml-tree too, but hopefully I'm going to land very hard on that tomorrow and beat it into something like a decent shape ;-) While I'm at it, how about some docs for the manage_* methods in the interfaces Wiki? </RANT> Okay, seriously, DTML is really hurting Zope's chances with a lot of people/companies. DTML should be easier than, say, creating a Form in Lotus Notes or writing a component in Mason. That requries, IMHO: 1. Clear definition of when it should be used. 2. A clean, concise syntax (like Python, DTML is more like Perl right now ;-) 3. Good documentation (much easier to do if 1 and 2 are met...) I also think having Python Methods ship with Zope would really help... There are niggles (like the rediculous id problem) which you can live with, but doing anything other than the really mundane in DTML means extreme hair loss right now, which is not good. I wonder how many other people would agree with me: nevermind ZEO, or the PTK, ZPatterns or any new fancy functionality. Can we at least have a decent template language that doesn't confuse the hell out of newbies and oldbies alike... cheers, Chris (Who just spent 1/2 hour figuring out how to do a multi-language site in Zope, and now after 6hrs of trying has given up doing a recursive tree copy to get the old site into the new structure with a DTML method or two and is resorting to ugly hacky external methods because Python Methods arent' around/stable) PS: Zope: yes it makes the hard things very easy, but it makes the easy things very hard, so it all balances out nicely... ;-)
Chris Withers wrote:
Okay, seriously, DTML is really hurting Zope's chances with a lot of people/companies. DTML should be easier than, say, creating a Form in Lotus Notes or writing a component in Mason. That requries, IMHO: 1. Clear definition of when it should be used. 2. A clean, concise syntax (like Python, DTML is more like Perl right now ;-)
The idea of making an XML compliant DTML has been tossed around before. It would remove the difference between <dtml-var x> and <dtml-var "x">, since XML allows neither syntax. :-)
3. Good documentation (much easier to do if 1 and 2 are met...)
How about a "namespace inspector"? It could provide an easy way to find out what methods are available and the what the calling conventions are (since it would interface with the help system), and it could be automatically invoked when exceptions occur (under certain conditions), making it a Zope debugging tool.
I also think having Python Methods ship with Zope would really help...
I'm working on enhancing Python Methods right now. I'm close to getting them properly interfaced with DTML namespaces, so that DTML can invoke Python Methods using simpler DTML syntax.
There are niggles (like the rediculous id problem) which you can live with, but doing anything other than the really mundane in DTML means extreme hair loss right now, which is not good.
A curious paradox: newbies need it to be easier, but experienced users need consistency.
I wonder how many other people would agree with me: nevermind ZEO, or the PTK, ZPatterns or any new fancy functionality. Can we at least have a decent template language that doesn't confuse the hell out of newbies and oldbies alike...
It doesn't confuse Jim! ;-) Shane
Shane Hathaway wrote:
The idea of making an XML compliant DTML has been tossed around before. It would remove the difference between <dtml-var x> and <dtml-var "x">, since XML allows neither syntax. :-)
I'm not too hot on XML compliancy, but if it makes the problems I mentioned go away, then great :-)
3. Good documentation (much easier to do if 1 and 2 are met...)
How about a "namespace inspector"? It could provide an easy way to find out what methods are available and the what the calling conventions are (since it would interface with the help system), and it could be automatically invoked when exceptions occur (under certain conditions), making it a Zope debugging tool.
Sounds interesting but it's never going to beat a decent paper reference with examples...
I'm working on enhancing Python Methods right now. I'm close to getting them properly interfaced with DTML namespaces, so that DTML can invoke Python Methods using simpler DTML syntax.
Hmmm, how about just sorting out the problems: dtml-var and dtml-call <dtml-var "x(_,_.None,arg1=x,arg2='y',arg3=3)" html_quote> should really be: <dtml-var x arg1=x arg2='y' arg3=3 html_quote> ...IMNSHO ;-)
A curious paradox: newbies need it to be easier, but experienced users need consistency.
I don't see a paradox, these two are both solved by sorting out the same problems.
It doesn't confuse Jim! ;-)
<dtml-call "REQUEST.set('id','answer1')"> <dtml-if "_[_[id]]=='funny'"> So lobotomize Jim, then he'll know what it's like for the rest of us! :P <dtml-else> Yes, but if Jim is the only person who understands it, then no-one else will be able to use it, DC will have no customers and we'll all be building sites using CORBA, beans and otehr 'things' </dtml-if> Thanks for the comments though, Ethan metnioned this as a project for dev.zope.org. I'm really up for that, would you be able to help out? cheers, Chris
Hi, Chris Withers wrote:
Hmmm, how about just sorting out the problems: dtml-var and dtml-call
<dtml-var "x(_,_.None,arg1=x,arg2='y',arg3=3)" html_quote>
should really be:
<dtml-var x arg1=x arg2='y' arg3=3 html_quote>
I want that too. When we are over it, how about replacing (or at least aliasing) these - variables to _ ? sequence-item, sequence-index etc. comes to mind. I would do it in some minutes if one wants it... Regards Tino Wildenhain
Tino Wildenhain wrote:
I want that too. When we are over it, how about replacing (or at least aliasing) these - variables to _ ? sequence-item, sequence-index etc. comes to mind.
Yes indeed! :-) IF you've got a patch that will do this, please mail it to me and stick it in the collector... cheers, Chris
On Tue, 11 Jul 2000, Chris Withers wrote:
Tino Wildenhain wrote:
I want that too. When we are over it, how about replacing (or at least aliasing) these - variables to _ ? sequence-item, sequence-index etc. comes to mind.
IF you've got a patch that will do this, please mail it to me and stick it in the collector...
Note that DC has in the (recent) past expressed reluctence to do this. I don't understand why. Something about namespace pollution? --RDM
Hi!
Brian Lloyd wrote: <snip id is sometimes a method (not always though ;-)>
This is one of the things on my List Of Evil Things that should be changed one day in Zope3K :)
<RANT type="angry,frustrated">
How about the nasty hacky mess that is DTML?
Some priceless artifacts that need to go:
<dtml-var "someMethod(_, _.None, myparam)"> <dtml-call "REQUEST.set('keyname','value')"> <dtml-let x="'hello out there'"> <dtml-var "_[REQUEST['myDoc']]">What is this supposed to do?! <dtml-var "PARENTS[-1].folder.getitem(_.getitem('id',1))">
and maybe <dtml-var "REQUEST[_['sequence-item']]">
Not to mention the horribleness that is <dtml-in> and <dtml-with>.
There's dtml-tree too, but hopefully I'm going to land very hard on that tomorrow and beat it into something like a decent shape ;-)
While I'm at it, how about some docs for the manage_* methods in the interfaces Wiki?
</RANT>
Okay, seriously, DTML is really hurting Zope's chances with a lot of people/companies. DTML should be easier than, say, creating a Form in Lotus Notes or writing a component in Mason. That requries, IMHO: 1. Clear definition of when it should be used. 2. A clean, concise syntax (like Python, DTML is more like Perl right now ;-) 3. Good documentation (much easier to do if 1 and 2 are met...)
I also think having Python Methods ship with Zope would really help...
Actually I also like it more to code stuff in Python. It's so much easier than to figure out how to do it in DTML. Basically what I like in Zope is the environment you also have in Python Products, like Acquisition. This is quite handy. That's why I try to do most stuff in Python Products then in DTML. But actually this is not one of the main things which were thought about a lot as it's still not that easy to use Products as ZClasses (and be it only the managing of Products.. You might want to have different locations for different products etc. ) And another thing I don't like about DTML is the mixture between code and layout. IMHO this is a bad thing. This is also the reason why I switched from PHP to Python some time ago.. What I would think as more useful is to provide some custom tags by the website developer which the website designer can then use. These should be abstract and clear in meaning. The actual implementating of these tags could then be done separately in maybe Python.. (we had this before.. maybe the XML stuff can help here). The advantage would also be that you can provide quite powerful tags like an easy handling of database forms, etc. (I did this some time ago with pure python.. developing with it is quite fast. One day and you have your basic database frontend with some basic CMS stuff.) But nevertheless for basic tasks a good template language is neccessary. And I agree with Chris that things like the above mentioned make it not that usable/readable.
There are niggles (like the rediculous id problem) which you can live with, but doing anything other than the really mundane in DTML means extreme hair loss right now, which is not good.
I wonder how many other people would agree with me: nevermind ZEO, or the PTK, ZPatterns or any new fancy functionality. Can we at least have a decent template language that doesn't confuse the hell out of newbies and oldbies alike...
yep.
PS: Zope: yes it makes the hard things very easy, but it makes the easy things very hard, so it all balances out nicely... ;-)
:) -- christian
On Mon, 10 Jul 2000, Chris Withers wrote:
(Who just spent 1/2 hour figuring out how to do a multi-language site in Zope, and now after 6hrs of trying has given up doing a recursive tree copy to get the old site into the new structure with a DTML method or two and is resorting to ugly hacky external methods because Python Methods arent' around/stable)
This probably isn't what you want to hear, but doing it in Python rather than DTML was probably the Right Choice to start with. A tree copy is a programming task, not a presentation task, and DTML is (supposed to be <grin>) for presentation not programming. Which doesn't mitigate against any of your comments about DTML being in poor shape... --RDM
"R. David Murray" wrote:
This probably isn't what you want to hear, but doing it in Python rather than DTML was probably the Right Choice to start with. A tree copy is a programming task, not a presentation task, and DTML is (supposed to be <grin>) for presentation not programming.
I totally agree with this. The reason I tried DTML was because to do anything in Python I have to resort to either an external method or writing a python product! And of course, once you start something, you really want to prove it was possible (which it should be, just executes a little slower! :P) cheers, Chris
participants (5)
-
Chris Withers -
cs@comlounge.net -
R. David Murray -
Shane Hathaway -
Tino Wildenhain