I might be out of date, but I just discovered the set tag. http://www.zope.org/Members/Ivo/SetTag I'm not going to install it (cause I'm not alone on the server and I don't want to confuse my close zope friends), but I like it a lot. Maybe I should have cross posted this message to zope-dev?? The set tag is described at: http://www.zopelabs.com/cookbook/992331398 by ivo. Simplest case: # old situation <dtml-call "REQUEST.set('foo', 10*2)"> # new situation <dtml-set foo="10*2"> I know little about this product, but I like it because newbies will like it. It is very intuitive and makes a lot of DTML sense. So many of the Zope newbies are developers who come from Perl or ASP or whatever, and instead of forcing all the new stuff on them, we should invite them humbly by making them feel at home. Sucking up to newbies in a nutshell :) What does DC think about this? My vote is for including it in DTML in the near future after proper QA.
Peter Bengtsson wrote:
Maybe I should have cross posted this message to zope-dev??
Maybe you shouldn't ;-)
Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** ^^^^^^^^^^^^^^
The set tag is described at: http://www.zopelabs.com/cookbook/992331398 by ivo.
Simplest case: # old situation <dtml-call "REQUEST.set('foo', 10*2)">
# new situation <dtml-set foo="10*2">
Actually, the new situation has been around since 2.3.0: If you need to do this kindof thing, chances are you doing something business-logic-y, in which case you should be using a PythonScript ;-) cheers, Chris
Wait a second... did I just see Chris Withers defending a party line? - C ----- Original Message ----- From: "Chris Withers" <chrisw@nipltd.com> To: "Peter Bengtsson" <mail@peterbe.com> Cc: <zope@zope.org> Sent: Tuesday, June 12, 2001 9:51 AM Subject: Re: [Zope] The Set tag, DC?
Peter Bengtsson wrote:
Maybe I should have cross posted this message to zope-dev??
Maybe you shouldn't ;-)
Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** ^^^^^^^^^^^^^^
The set tag is described at: http://www.zopelabs.com/cookbook/992331398 by ivo.
Simplest case: # old situation <dtml-call "REQUEST.set('foo', 10*2)">
# new situation <dtml-set foo="10*2">
Actually, the new situation has been around since 2.3.0: If you need to do this kindof thing, chances are you doing something business-logic-y, in which case you should be using a PythonScript ;-)
cheers,
Chris
_______________________________________________ Zope maillist - Zope@zope.org 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 )
Actually, the new situation has been around since 2.3.0: If you need to do this kindof thing, chances are you doing something business-logic-y, in which case you should be using a PythonScript ;-)
Yeah yeah. I know, but I did too mention "for newbies", which I consider myself not to be. I have seen cases where people who are new to Zope say """that's "stupid" and you have to be an expert to understand that"""%(but after a while they realize that it's all pretty smart when you understand it) DC changed their mind about the so annoying superuser account. Not because it was technically wrong, but because it was confusion to beginners :) Well done DC!! The more newbies (users of Zope) the richer I get, because my skills increase in value. So, more users is very important to me.
cheers,
Chris
_______________________________________________ Zope maillist - Zope@zope.org 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 )
Peter Bengtsson wrote:
Actually, the new situation has been around since 2.3.0: If you need to do this kindof thing, chances are you doing something business-logic-y, in which case you should be using a PythonScript ;-)
Yeah yeah. I know, but I did too mention "for newbies", which I consider myself not to be.
This point is _the_ most important thing to stress to new users...
DC changed their mind about the so annoying superuser account. Not because it was technically wrong, but because it was confusion to beginners
That was arguably technically wrong and there was no positive side to it...
The more newbies (users of Zope) the richer I get, because my skills increase in value. So, more users is very important to me.
...yes, but if you give someone a loaded gun and point it at their heads for them, they may well pull the trigger by accident and then you have one less Zope user ;-) If you encourage good programming practices from the start, new users won't end up with a complete birds nest of DTML that means nothing to them or anyone else. And if they don't end up in that position, they're less likely to look at Zope as 'messy' and 'difficult to understand' before running off to find a saner solution. Maybe in Perl, which would probably be cleaner ;-) cheers, Chris
Colf Fusion has a "set" tag - <cfset> - easy to use and understand - I strongly favor having one in Zope. Cheers, Tom P
You mean for setting variables? There's a product called dtml-set that let's you do this. search the zope.org site for it. works great for me. -Kevin --- "Thomas B. Passin" <tpassin@mitretek.org> wrote:
Colf Fusion has a "set" tag - <cfset> - easy to use and understand - I strongly favor having one in Zope.
Cheers,
Tom P
_______________________________________________ Zope maillist - Zope@zope.org 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 )
__________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/
"Thomas B. Passin" wrote:
Colf Fusion has a "set" tag - <cfset> - easy to use and understand - I strongly favor having one in Zope.
Cheers,
Tom P
I would like to argue for the following: That DTML methods and documents have scratch namespace that is created at the top of the stack before the code is executed. This namespace would be initially empty and automatically scoped so that it is popped off when the method completes. This would give DTML a true local variable space, at little expense. This way a "dtml-set" or "dtml-eval" tag could store there values in this namespace instead of using REQUEST at the bottom of the stack, which I feel leads to newbie frustration, since in every other langauge, local variables override global ones, not the other way around. It should also be backwards compatible since REQUEST.set would continue to function just as before. I wrote the eval tag which attempts approximate this functionality (still using REQUEST though), and I always thought this would be the best way to extend it. I think a fishbowl project is warranted here, I would be willing to write it up if there is support. For those otherwise unaware of dtml-eval, it lets you do this: <dtml-eval> x = _.len(sequence) y = sequence[0] </dtml-eval> Basically write expressions in blocks without quoting and optionally assign them to namespace variables. -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
Casey Duncan wrote:
That DTML methods and documents have scratch namespace that is created at the top of the stack before the code is executed. This namespace would be initially empty and automatically scoped so that it is popped off when the method completes. This would give DTML a true local variable space, at little expense.
This is exactly what happens with the _ namespace ;-) Look at the dtml-let and dtml-with tags and the _.namespace function... cheers, Chris
--On 06/12/01 15:16:04 +0200 Peter Bengtsson chiseled:
Simplest case: # old situation <dtml-call "REQUEST.set('foo', 10*2)">
# new situation <dtml-set foo="10*2">
Better: <html tal:define="foo here/python_script"> ZPT is the bomb. Seriously. -- -mindlace- zopatista community liason
participants (8)
-
Andy McKay -
Casey Duncan -
Chris McDonough -
Chris Withers -
ethan mindlace fremen -
Kevin L -
Peter Bengtsson -
Thomas B. Passin