Re: [Zope] why DTML confusing
On Sat, 11 Nov 2000, Andy McKay wrote: It might be that fixing one or both of the above would reduce the DTML pain factor quite a bit. Certainly, it's time to do whatever it takes to banish these "-"-named variables, IMHO. I agree, changing the "-" to "_" would remove a whole ton of posts on this list and mean I could chop a whole bunch of dtml-let item=sequence-item. I really only see negative reasons for a "-". I've tried starting this call some time ago, but it never managed to pick up steam. Last time, however, someone pointed to an existing patch to do just that: change *-* variable names to *_* . If only I could remember where it was... Have a better one, Curtis Maloney ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] why DTML confusing
- Original Message - From: Simon Michael [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 11, 2000 12:59 AM Subject: Re: [Zope] why DTML confusing Charlie Wilkinson [EMAIL PROTECTED] writes: ...or "the python world with some Zope limitations placed on it." ... There's a third world of course, HTML. Most of us probably have that True, true. Actually this sounds like a good structure for a overview doc: "Welcome to Zope.. in which we shall encounter 1. the plain of Text 2. the fields of HTML 3. the DTML domain 4. the ZClass lands 5. the Scripting realms; in which dwell Expressions, Methods and Python/Perl/XSLT" 6. the unbound Scripting realms; here be External Methods 7. the halls of the Serpent; where dwell it's Products Descend now into.. DC's Seven Circles Of Hell." (affectionately misnamed :-) Hm, nice overview. What would be missing is a general Web/HTTP section. That's another part we always take for granted, but it is not. At least, that's my experience from two recent introductions of Zope. So, to continue in your vein: before we land in Zope land we should go through 1. The World of the Web and why it needs a Server of Applications 2. Where we draw up Requests and Encode them 3. Learn about the Protocols that are Spoken 4. Understand the mysteries of Common Gateways 5. Pass the Secret Ways of Authorisation and Authentication Rik ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] why DTML confusing
It's a give-and-take I think. I had the same confusion as you have right now, but after a while you learn this syntax pretty well. This is the same as with all syntax, and as soon as you have learned the basics the rest is easy and from then on a matter of learning how to use extensive functions and methods. I found DTML confusing as well in the begining, but I know feel that DTML is not bad at all. The DTML syntax is sometimes even more convenient than - otherwise known to be simple - PHP syntax. If you read the Zope Book by Michael and Amos you'll be told to use Python Methods for almost all functionality and leave DTML as a very basic tool for your content visualization. Don't give up Irene! This is just part of the steep (almost exponential) Zope learning curve. Greetings, peter I say this is confusing. Don't tell me to read the Namespace How-to, or the Zope User Guides, I did, and it's still confusing! Unless you find an example, that does exactly what you want, trying to figure it out with the documentation available can be difficult. I found my answer to this in the "How-To: (How-to) access the field names and fields of any arbitrary ZSQL query", but it took a lot of searching the Zope site for references to 'dtml-in'. I get so frustrated with DTML, I want to scream. Please don't tell me to buy the Zope book, DTML should be more intuitive. DTML maybe the heart of Zope, but it's also it's achilles heel. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] why DTML confusing
Irene Barg [EMAIL PROTECTED] writes: 1. You can print the values of sequence-items with: (index=dtml-var sequence-index, number=dtml-var sequence-number, item=dtml-var sequence-item) 2. To test for equality, this does not: dtml-if "sequence-index == 0" (dtml-var count-adassnum Records found) /dtml-if 3. While this does work: dtml-if "_['sequence-index'] == 0" (dtml-var count-adassnum Records found) /dtml-if I say this is confusing. Don't tell me to read the Namespace How-to, or the Zope User Guides, I did, and it's still confusing! Unless you find an example, that does exactly what you want, trying to figure it out with the documentation available can be difficult. I found my answer to this in the "How-To: (How-to) access the field names and fields of any arbitrary ZSQL query", but it took a lot of searching the Zope site for references to 'dtml-in'. I get so frustrated with DTML, I want to scream. Please don't tell me to buy the Zope book, DTML should be more intuitive. DTML maybe the heart of Zope, but it's also it's achilles heel. -- irene -- Irene BargEmail: [EMAIL PROTECTED] Steward Observatory Phone: 520-621-2602 933 N. Cherry Ave. University of Arizona FAX:520-621-1891 Tucson, AZ 85721 http://nickel.as.arizona.edu/~barg -- ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] why DTML confusing
* peter bengtson ([EMAIL PROTECTED]) [001110 10:40]: It's a give-and-take I think. I had the same confusion as you have right now, but after a while you learn this syntax pretty well. This is the same as with all syntax, and as soon as you have learned the basics the rest is easy and from then on a matter of learning how to use extensive functions and methods. Considering that DTML is supossed to be for web/html writers, *not* for programmers, I think that's not a good attitude to take. I don't want web-writers having to figure out that to access a variable, *that was being use a second ago with no extra syntax* suddenly needs _[''] wrapped around it. It doesn't make any sense UNLESS you know what's going on underneith. And since the whole attitude for Zope is, "do it right". I'd say this needs to be addressed at some point. Ciao! -- Although the moon is smaller than the earth, it is farther away. The Doctor What: A really hip dude http://docwhat.gerf.org/ [EMAIL PROTECTED] KF6VNC ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] why DTML confusing
It might be that fixing one or both of the above would reduce the DTML pain factor quite a bit. Certainly, it's time to do whatever it takes to banish these "-"-named variables, IMHO. Agreed. But DC always raises objections when this is brought up. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] why DTML confusing
It might be that fixing one or both of the above would reduce the DTML pain factor quite a bit. Certainly, it's time to do whatever it takes to banish these "-"-named variables, IMHO. I agree, changing the "-" to "_" would remove a whole ton of posts on this list and mean I could chop a whole bunch of dtml-let item=sequence-item. I really only see negative reasons for a "-". -- Andy McKay, Developer. ActiveState. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] why DTML confusing
From: Andy McKay It might be that fixing one or both of the above would reduce the DTML pain factor quite a bit. Certainly, it's time to do whatever it takes to banish these "-"-named variables, IMHO. I agree, changing the "-" to "_" would remove a whole ton of posts on this list and mean I could chop a whole bunch of dtml-let item=sequence-item. I really only see negative reasons for a "-". For once I will send a "me too" to the list. "sequence-item" is a simple and plain design error. Decapricate it and and let us use "sequence_item" etc. together with the other for a while and then drop the old form. It is the single most annoying thing in dtml, and as far as I can see in the source it should be trivial to give all those sequence-* a sequence_* name also. Regards Max M Max M. W. Rasmussen,Denmark. New Media Director private: [EMAIL PROTECTED] work: [EMAIL PROTECTED] - Specialization is for insects. - Robert A. Heinlein ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] why DTML confusing
[Max M.] | For once I will send a "me too" to the list. "sequence-item" is a simple and | plain design error. Decapricate it and and let us use "sequence_item" etc. | together with the other for a while and then drop the old form. I'd like to join this mob. ;) It's painful and ugly to use "_['sequence-item']", "_['sequence-index']" etc... -Morten ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] why DTML confusing
First Simon, thanks for your message. Yours is one of the most articulate explanations I've seen on this topic. Simon Michael [EMAIL PROTECTED] writes: Irene Barg [EMAIL PROTECTED] writes: [examples of DMTL confusion...] It is confusing. There are two systems of syntax in use here - DTML's and python's. Once you start using "" expressions, you have left DTML and you are in the python world. ...or "the python world with some Zope limitations placed on it." There's a third world of course, HTML. Most of us probably have that down solid, so we tend not to think of it in the context of "skills needed to master Zope." But whether it's wrapping data in an HTML table, or how to create dynamic CGI forms, mastering the integration of HTML and DTML is a critical skill that some apparently find difficult. (I've seen HOWTO's for it...) - unfortunate reality #1: you have to use "" expressions to do any kind of comparison, so you are pretty much forced into dealing with these two worlds right from the beginning. That's fine, but in the interests of good will and sanity, Zope should probably have a big fat warning label saying "DO NOT VENTURE HERE IF YOU DO NOT ALREADY KNOW, OR PLAN TO LEARN PYTHON." I did know Zope was written in Python. I did not expect that I would have to learn it. Maybe that was stupid on my part, but that's what I thought. Still, entering the python world would normally be a good thing, since syntax there is simple and consistent. But, - unfortunate reality #2: certain legacy zope variables contain "-" in their name. In the python world, this is illegal (or rather it means something different) and so you are forced to remember constructs like _['sequence-index'] all the time. It might be that fixing one or both of the above would reduce the DTML pain factor quite a bit. Certainly, it's time to do whatever it takes to banish these "-"-named variables, IMHO. Yes, it would help a lot. _[] is about as non-intuitive as you can get, especially after mixing in all the single and double quotes. Sure, if you understand python and how DTML wraps around it, it all makes sense, but that's a pretty narrow market and DMTL simply doesn't need to be that obfuscated. If the intended market is simply "people who grok Python", then there's really no point in something as Point n' Click n' GUI as Zope is. I certainly don't have all the answers, but it seems a simple matter to allow both sequence-index *and* sequence_index - i.e., create underscore equivalents alongside all the legacy "hyphen" variables. If I recall, I've even seen some user-contributed patches on this list to do just that. That's just one example of something in Zope that's "too difficult" screaming for change. But one of the practical advantages of making that kind of change is that the people who contribute their valuable time to help the newbies (and not-so-newbies) on this list won't spend quite so much time saying Try this: dtml-in "AUTHENTICATED_USER.getRoles()" dtml-if "_['sequence-item'] == 'Admin'" dtml-call "REQUEST.set('edit_ok','y')" /dtml-if /dtml-in That's an awful lot of weird syntax glue just to walk a list and set a value based on values in the list. If someone asked how to do that on a Perl mailing list, they'd be RTFM'ed and run out of town. Maybe that's not an entirely fair comparison, but still, how much of that syntax nightmare might be avoidable? I really don't know enough to say. Obviously *everything* has to be wrapped in something that at least distinguishes DTML from HTML. How quickly or deeply (or just *how*) one should get into python after that is another matter. Zope reminds me of NT in some ways (except that I *like* Zope). Zope, like NT, presents this illusion of friendly, easy learning curve, straight-forward "get the job done and move on" philosophy. At least that was my first impression. Then reality struck and I'm still recovering! What keeps me working with Zope is not so much what Zope is, but the promise of what it can be. (And the hope that when I'm finally a Python ace and understand the Zope source code from nose to tail, I'll be ready to work in DTML ;-) -cw- -- ~ Charlie Wilkinson - [EMAIL PROTECTED] - N3HAZ Parental Unit, UNIX Admin, Homebrewer, Cat Lover, Spam Fighter, HAM, SWLer... Visit the Radio For Peace International Website: http://www.rfpi.org/ ~ CLOBBER INTERNET SPAM: See!! http://spam.abuse.net/ Join!! http://www.cauce.org/ ~ QOTD: "Bush is a big corporation disguised as a human being running for president." -- Ralph Nader on David Letterman (9/28/00)
Re: [Zope] why DTML confusing
Charlie Wilkinson [EMAIL PROTECTED] writes: ...or "the python world with some Zope limitations placed on it." ... There's a third world of course, HTML. Most of us probably have that True, true. Actually this sounds like a good structure for a overview doc: "Welcome to Zope.. in which we shall encounter 1. the plain of Text 2. the fields of HTML 3. the DTML domain 4. the ZClass lands 5. the Scripting realms; in which dwell Expressions, Methods and Python/Perl/XSLT" 6. the unbound Scripting realms; here be External Methods 7. the halls of the Serpent; where dwell it's Products Descend now into.. DC's Seven Circles Of Hell." (affectionately misnamed :-) -Simon ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )