[Zope3-Users] test() in TALES in Zope3

2006-02-01 Thread Frank Burkhardt
Hi, in Zope2 there's a test() method that can be used in TAL (*). Is there something comparable in Zope3? I know how to write such a method but how to make it available in the namespace of TALES-python:-expressions? I would like to write expressions like this: div tal:attributes=class python:

Re: [Zope3-Users] test() in TALES in Zope3

2006-02-01 Thread Andreas Jung
--On 1. Februar 2006 09:04:36 +0100 Frank Burkhardt [EMAIL PROTECTED] wrote: Hi, in Zope2 there's a test() method that can be used in TAL (*). Is there something comparable in Zope3? I know how to write such a method but how to make it available in the namespace of

Re: [Zope3-Users] test() in TALES in Zope3

2006-02-01 Thread Frank Burkhardt
On Wed, Feb 01, 2006 at 09:04:36AM +0100, Frank Burkhardt wrote: [snip] div tal:attributes=class python: 'foo' + test(condition == True,' bar','') / Is this possible? Impressing simple solution :-) . Thank you Andreas and Igor. Frank ___

[Zope3-Users] Looking for PathIndex

2006-02-01 Thread Thierry FLORAC
Hi ! I'm actually trying to create a Zope3 application, where I may be able to make queries : - looking for content in the whole site - looking for content in a given sub-site or list of sub-sites, eventually including all it's sub-folders. With Zope2, I was commonly using a PathIndex

Re: [Zope3-Users] Group membership based on authenticator

2006-02-01 Thread Stephan Richter
On Wednesday 01 February 2006 01:46, Marko Mikulicic wrote: subscriber     for=zope.app.authentication.interfaces.IPrincipalCreated     handler=.mytest.principalCreated     / and then if the prefix of the event.principal.id is what I like   then add some group to it, but I don't like the

Re: [Zope3-Users] Looking for PathIndex

2006-02-01 Thread Gary Poster
On Feb 1, 2006, at 3:12 AM, Thierry FLORAC wrote: Hi ! I'm actually trying to create a Zope3 application, where I may be able to make queries : - looking for content in the whole site - looking for content in a given sub-site or list of sub-sites, eventually including all it's

Re: [Zope3-Users] test() in TALES in Zope3

2006-02-01 Thread Gary Poster
On Feb 1, 2006, at 3:17 AM, Frank Burkhardt wrote: On Wed, Feb 01, 2006 at 09:04:36AM +0100, Frank Burkhardt wrote: [snip] div tal:attributes=class python: 'foo' + test(condition == True,' bar','') / Is this possible? Impressing simple solution :-) . FWIW the classic Zope 3 solution

Re: [Zope3-Users] test() in TALES in Zope3

2006-02-01 Thread Andreas Jung
--On 1. Februar 2006 07:56:47 -0500 Gary Poster [EMAIL PROTECTED] wrote: On Feb 1, 2006, at 3:17 AM, Frank Burkhardt wrote: On Wed, Feb 01, 2006 at 09:04:36AM +0100, Frank Burkhardt wrote: [snip] div tal:attributes=class python: 'foo' + test(condition == True,' bar','') / Is this

Re: [Zope3-Users] test() in TALES in Zope3

2006-02-01 Thread Gary Poster
On Feb 1, 2006, at 8:07 AM, Andreas Jung wrote: --On 1. Februar 2006 07:56:47 -0500 Gary Poster [EMAIL PROTECTED] wrote: FWIW the classic Zope 3 solution is to say Don't do that in the template! Do it in the view class!. I'll let others add vigor, if they wish. I just wanted you to know

RE: [Zope3-Users] test() in TALES in Zope3

2006-02-01 Thread Roger Ineichen
Hi Andreas [...] FWIW the classic Zope 3 solution is to say Don't do that in the template! Do it in the view class!. I'll let others add vigor, if they wish. I just wanted you to know the purist answer in case you cared. ;-) If you have only one python: statement within your

Re: [Zope3-Users] test() in TALES in Zope3

2006-02-01 Thread Benji York
Andreas Jung wrote: Frank Burkhardt [EMAIL PROTECTED] wrote: in Zope2 there's a test() method that can be used in TAL (*). Is there something comparable in Zope3? You can write this in Python as condition and true_expression or false_expression In Python 2.5 you'll be able to write

RE: [Zope3-Users] test() in TALES in Zope3

2006-02-01 Thread Andreas Jung
--On 1. Februar 2006 14:25:42 +0100 Roger Ineichen [EMAIL PROTECTED] wrote: Don't forget about the better overview in the project if you put application logic in view classes. (No more page template reading and macro searching for a code review) I knew that you love those kind of

[Zope3-Users] Please Guido, pick me, pick me!

2006-02-01 Thread Wade Leftwich
Guido van Rossum is looking for a web app framework. http://blog.delaguardia.com.mx/index.php?op=ViewArticlearticleId=34blogId=1 Zope is conspicuous by its absence from the discussion. Hardly a mention, and no advocacy at all. Is Zope just too heavyweight for the project he has in mind? Or

Re: [Zope3-Users] Please Guido, pick me, pick me!

2006-02-01 Thread Dmitry Vasiliev
Wade Leftwich wrote: Guido van Rossum is looking for a web app framework. http://blog.delaguardia.com.mx/index.php?op=ViewArticlearticleId=34blogId=1 Zope is conspicuous by its absence from the discussion. Hardly a mention, and no advocacy at all. Is Zope just too heavyweight for the project

Re: [Zope3-Users] Please Guido, pick me, pick me!

2006-02-01 Thread ksmith99 (sent by Nabble.com)
He'll be back. After he finishes the project, Google will tweak the requirements a few times, and GvR will need to refactor. After he throws out and/or completely restructures 90% of his code, he'll look for a different solution. Interfaces, components and zcml will start looking real nice. I

Re: [Zope3-Users] test() in TALES in Zope3

2006-02-01 Thread Michael Dudzik
On Wed, 01 Feb 2006 09:07:17 +0100, Andreas Jung [EMAIL PROTECTED] said: --On 1. Februar 2006 09:04:36 +0100 Frank Burkhardt [EMAIL PROTECTED] wrote: Hi, in Zope2 there's a test() method that can be used in TAL (*). Is there something comparable in Zope3? I know how to write

Re: [Zope3-Users] test() in TALES in Zope3

2006-02-01 Thread Igor Stroh
Michael Dudzik wrote: On Wed, 01 Feb 2006 09:07:17 +0100, Andreas Jung [..] in Zope2 there's a test() method that can be used in TAL (*). Is there something comparable in Zope3? I know how to write such a method but how to make it available in the namespace of TALES-python:-expressions? I would

Re: [Zope3-Users] Please Guido, pick me, pick me!

2006-02-01 Thread Stephan Richter
On Wednesday 01 February 2006 12:51, ksmith99 (sent by Nabble.com) wrote: He'll be back. After he finishes the project, Google will tweak the requirements a few times, and GvR will need to refactor. After he throws out and/or completely restructures 90% of his code, he'll look for a different

Fwd: Re: [Zope3-Users] test() in TALES in Zope3

2006-02-01 Thread Michael Dudzik
On Wed, 01 Feb 2006 19:15:13 +0100, Igor Stroh [EMAIL PROTECTED] said: Michael Dudzik wrote: On Wed, 01 Feb 2006 09:07:17 +0100, Andreas Jung [..] in Zope2 there's a test() method that can be used in TAL (*). Is there something comparable in Zope3? I know how to write such a method but

[Zope3-Users] Re: Fwd: Re: test() in TALES in Zope3

2006-02-01 Thread Florent Guillaume
Michael Dudzik wrote: Sure, but what about when you don't know the boolean value ahead of time, like: C and f(x) or g(x) On the other hand, (g(x), f(x))[C] works every time To be fair, both g(x) and f(x) are evaluated while f(x) if C else g(x) # python 2.5, only evaluates the

Re: [Zope3-Users] Re: Fwd: Re: test() in TALES in Zope3

2006-02-01 Thread Michael Dudzik
On Wed, 01 Feb 2006 20:26:24 +0100, Florent Guillaume [EMAIL PROTECTED] said: Michael Dudzik wrote: Sure, but what about when you don't know the boolean value ahead of time, like: C and f(x) or g(x) On the other hand, (g(x), f(x))[C] works every time To be fair, both g(x)

Re: [Zope3-Users] Re: Fwd: Re: test() in TALES in Zope3

2006-02-01 Thread Michael Dudzik
On Wed, 1 Feb 2006 14:57:58 -0500, Paul Winkler [EMAIL PROTECTED] said: Prior to python 2.5, there is AFAIK no other always-works short-circuiting one-line conditional expression but this: (bool(C) and [foo] or [bar])[0] Agreed that that works every time, but so does: (bar,foo)[bool(C)] Each