Re: [Zope] Help with simple dtml-if compare

2000-05-26 Thread Rik Hoekstra



> 
> yep.. well... this is quite a common question, all up.  It comes from people
> using shorthand, but not relaising it.  sometimes i wonder if this feature
> should be removed.
> 
> the line:
> 
> 
> 
> is actually shorthand for:
> 
> 
> 
> which means your expression is handled as a python expression, not a DTML
> one.  In which case, you are comparing a function object (id)  with a string
> object ('index_html').
> 
> the simple fix is, of course, to 'call' the function
> 
> 
> 
> should do what you're expecting.


Um, except that id is not always a method ;-(, hence the _['id'] idiom
(see discussion earlier this week)

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] Help with simple dtml-if compare

2000-05-26 Thread Graham Chiu

In article <[EMAIL PROTECTED]>, Patrick J.M. Keane
<[EMAIL PROTECTED]> writes
>

 

as discussed yesterday in this list!

-- 
Regards,  Graham Chiu
gchiucompkarori.co.nz
http://www.compkarori.co.nz/index.php
Powered by Interbase and Zope

___
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] Help with simple dtml-if compare

2000-05-26 Thread Patrick J.M. Keane


Thanks for the quick fix.  I really thought it was time to go to bed.  Now that
it makes sense, I have to rethink whether I have enough evidence that I'm
tired.  :-)

pk



___
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] Help with simple dtml-if compare

2000-05-26 Thread Curtis Maloney

On Fri, 26 May 2000, Patrick J.M. Keane wrote:
> Bug?  Or am I missing something.
>
most likely you're missing something. (o8

> Create a default document called 'index_html', with these contents:
>
> 
> 
> index_html == 
> 
> index_html != 
> 
> 
>
> Basically, we're comparing the document id -- "index_html" to the string
> "index_html".

yep.. well... this is quite a common question, all up.  It comes from people 
using shorthand, but not relaising it.  sometimes i wonder if this feature 
should be removed.

the line:



is actually shorthand for:



which means your expression is handled as a python expression, not a DTML 
one.  In which case, you are comparing a function object (id)  with a string 
object ('index_html').

the simple fix is, of course, to 'call' the function



should do what you're expecting.

> Thanks
> PK
>



-- 
Have a better one,
Curtis.



___
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] Help with simple dtml-if compare

2000-05-26 Thread Patrick J.M. Keane


Bug?  Or am I missing something.

Create a default document called 'index_html', with these contents:



index_html == 

index_html != 



Basically, we're comparing the document id -- "index_html" to the string
"index_html".

If you run it, the results say:

index_html != index_html

Why is that??  Any help?  Ideas?

Thanks
PK


___
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 )