[Zope] expr
I get an error when using following expr: dtml-in expr="address_select(ADDRESS.CENTRE_NO=CENTRENO)" This is due to the . in ADDRESS.CENTRE_NO how can I use ADDRESS.CENTRE_NO so that I don't get this error? Tom. ___ 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] expr=id 'index_html issue
Okay, this is my second question for the day. Hopefully it won't be as easy as the first -- otherwise, I'll have to stick to practicing law. I'm looking for a way to list the DTML Methods in a folder -- except the index_html method. So far, I've had to do it by using this: dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="title 'The Title'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in This works but it is a maintenance headache. A more elegant (and reuseable) solution would be to use the id, which is always 'index_html' for the to-be-excluded method. However... dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="id 'index_html'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in .. doesn't work. Does anyone know why? Thanks in advance, Ron ./. ___ 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] expr=id 'index_html issue
Okay, this is my second question for the day. Hopefully it won't be as easy as the first -- otherwise, I'll have to stick to practicing law. I'm looking for a way to list the DTML Methods in a folder -- except the index_html method. So far, I've had to do it by using this: dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="title 'The Title'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in This works but it is a maintenance headache. A more elegant (and reuseable) solution would be to use the id, which is always 'index_html' for the to-be-excluded method. However... dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="id 'index_html'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in .. doesn't work. Does anyone know why? Short answer because id is not always a string you have to call it differently try untested but this is a faq: dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="_[id] 'index_html'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in hth 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] expr=id 'index_html issue
hi, as usual, if such things happen, "id" is a method. it gets called by zope if you just use dtml-var on it. So either use id() or better, look for title and if not set (dont set a title on html_index then) dont display it. Regards Tino [EMAIL PROTECTED] wrote: Okay, this is my second question for the day. Hopefully it won't be as easy as the first -- otherwise, I'll have to stick to practicing law. I'm looking for a way to list the DTML Methods in a folder -- except the index_html method. So far, I've had to do it by using this: dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="title 'The Title'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in This works but it is a maintenance headache. A more elegant (and reuseable) solution would be to use the id, which is always 'index_html' for the to-be-excluded method. However... dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="id 'index_html'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in .. doesn't work. Does anyone know why? Thanks in advance, Ron ./. ___ 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] expr=id 'index_html issue
try untested but this is a faq: dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="_[id] 'index_html'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in that should be dtml-if expr="_['id'] 'index_html'" (quotes round id) dtml-if expr="id() 'index_html'" would also work. This is because sometimes id is a property, sometimes it's a method. The former version would work in every case; the latter only where id is a method. It's annoying, but there's talk of providing a getId() method for every object to sort this inconsistency out. seb ___ 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] expr=id 'index_html issue
Seb Bacon wrote: try untested but this is a faq: dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="_[id] 'index_html'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in that should be dtml-if expr="_['id'] 'index_html'" (quotes round id) dtml-if expr="id() 'index_html'" would also work. This is because sometimes id is a property, sometimes it's a method. The former version would work in every case; the latter only where id is a method. It's annoying, but there's talk of providing a getId() method for every object to sort this inconsistency out. As far as I know, getId() is in CVS and is documented in the CVS API online help. You should be seeing it soon. -Michel ___ 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 )