hi, why doesn't this work? <dtml-if sequence-item.objectValues(['File'])> <td bgcolor="#EEEEEE"><dtml-let cType="sequence-item.getContentType()"><dtml-var cType></dtml-let></td> <dtml-else> <td bgcolor="#EEEEEE"><dtml-var meta_type></td> </dtml-if> is there some other way to display the content type of a file? thanks -<mike>-
Python doesn't like the "sequence-item.getContentType()" part. Try: "_['sequence-item'].getContentType()" --jfarr ----- Original Message ----- From: "michael angelo ruberto" <michaelangelo@webmind.com> To: <zope@zope.org> Sent: Tuesday, March 06, 2001 2:26 PM Subject: [Zope] stupid question
hi,
why doesn't this work?
<dtml-if sequence-item.objectValues(['File'])> <td bgcolor="#EEEEEE"><dtml-let cType="sequence-item.getContentType()"><dtml-var cType></dtml-let></td> <dtml-else> <td bgcolor="#EEEEEE"><dtml-var meta_type></td> </dtml-if>
is there some other way to display the content type of a file?
thanks
-<mike>-
_______________________________________________ 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 )
it seems i was performing some uneccessary steps here. i can just print the getContentType method. the problem is trying to trap just the object type. this works: <ul> <dtml-in expr="PARENTS[0].objectValues('File')"> <li><a href="<dtml-var absolute_url>"><dtml-var id></a> <dtml-var getContentType></li> </dtml-in> </ul> so the problem is with this: <dtml-if sequence-item.objectValues(['File'])> i must find another way to trap for File objects during the iteration. -<mike>- -----Original Message----- From: Jonothan Farr [mailto:jfarr@real.com] Sent: Tuesday, March 06, 2001 5:37 PM To: michaelangelo@webmind.com Cc: zope Subject: Re: [Zope] stupid question Python doesn't like the "sequence-item.getContentType()" part. Try: "_['sequence-item'].getContentType()" --jfarr ----- Original Message ----- From: "michael angelo ruberto" <michaelangelo@webmind.com> To: <zope@zope.org> Sent: Tuesday, March 06, 2001 2:26 PM Subject: [Zope] stupid question
hi,
why doesn't this work?
<dtml-if sequence-item.objectValues(['File'])> <td bgcolor="#EEEEEE"><dtml-let cType="sequence-item.getContentType()"><dtml-var cType></dtml-let></td> <dtml-else> <td bgcolor="#EEEEEE"><dtml-var meta_type></td> </dtml-if>
is there some other way to display the content type of a file?
thanks
-<mike>-
_______________________________________________ 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 )
this is quite strange. i can get this to work if i remove the <dtml-var meta_type> tag. <ul> <dtml-in expr="PARENTS[0].objectValues(['File','DTML Document'])"> <dtml-if _['sequence-item'].objectValues(['File'])> <li><a href="<dtml-var absolute_url>"><dtml-var id></a> <dtml-var getContentType></li> <dtml-else> <li><a href="<dtml-var absolute_url>"><dtml-var id></a> <dtml-var meta_type></li> </dtml-if> </dtml-in> </ul> for some reason the meta_type method overrides the getContentType method if they are both used. ???? -----Original Message----- From: Jonothan Farr [mailto:jfarr@real.com] Sent: Tuesday, March 06, 2001 5:37 PM To: michaelangelo@webmind.com Cc: zope Subject: Re: [Zope] stupid question Python doesn't like the "sequence-item.getContentType()" part. Try: "_['sequence-item'].getContentType()" --jfarr ----- Original Message ----- From: "michael angelo ruberto" <michaelangelo@webmind.com> To: <zope@zope.org> Sent: Tuesday, March 06, 2001 2:26 PM Subject: [Zope] stupid question
hi,
why doesn't this work?
<dtml-if sequence-item.objectValues(['File'])> <td bgcolor="#EEEEEE"><dtml-let cType="sequence-item.getContentType()"><dtml-var cType></dtml-let></td> <dtml-else> <td bgcolor="#EEEEEE"><dtml-var meta_type></td> </dtml-if>
is there some other way to display the content type of a file?
thanks
-<mike>-
_______________________________________________ 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 )
disregard the last message - i was being stupid. i thought this was working but it wasn't <dtml-if _['sequence-item'].objectValues(['File'])> back to the drawing board. ;) -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of michael angelo ruberto Sent: Tuesday, March 06, 2001 5:57 PM To: Jonothan Farr Cc: zope Subject: RE: [Zope] stupid question this is quite strange. i can get this to work if i remove the <dtml-var meta_type> tag. <ul> <dtml-in expr="PARENTS[0].objectValues(['File','DTML Document'])"> <dtml-if _['sequence-item'].objectValues(['File'])> <li><a href="<dtml-var absolute_url>"><dtml-var id></a> <dtml-var getContentType></li> <dtml-else> <li><a href="<dtml-var absolute_url>"><dtml-var id></a> <dtml-var meta_type></li> </dtml-if> </dtml-in> </ul> for some reason the meta_type method overrides the getContentType method if they are both used. ???? -----Original Message----- From: Jonothan Farr [mailto:jfarr@real.com] Sent: Tuesday, March 06, 2001 5:37 PM To: michaelangelo@webmind.com Cc: zope Subject: Re: [Zope] stupid question Python doesn't like the "sequence-item.getContentType()" part. Try: "_['sequence-item'].getContentType()" --jfarr ----- Original Message ----- From: "michael angelo ruberto" <michaelangelo@webmind.com> To: <zope@zope.org> Sent: Tuesday, March 06, 2001 2:26 PM Subject: [Zope] stupid question
hi,
why doesn't this work?
<dtml-if sequence-item.objectValues(['File'])> <td bgcolor="#EEEEEE"><dtml-let cType="sequence-item.getContentType()"><dtml-var cType></dtml-let></td> <dtml-else> <td bgcolor="#EEEEEE"><dtml-var meta_type></td> </dtml-if>
is there some other way to display the content type of a file?
thanks
-<mike>-
_______________________________________________ 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 )
_______________________________________________ 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 )
ok, ok, time for me to move my desk further from the microwave oven. here's the elusive epiphany: <ul> <dtml-in expr="PARENTS[0].objectValues(['File','DTML Document'])"> <dtml-if expr="(meta_type == 'File')"> <li><a href="<dtml-var absolute_url>"><dtml-var id></a> <dtml-var getContentType></li> <dtml-else> <li><a href="<dtml-var absolute_url>"><dtml-var id></a> <dtml-var meta_type></li> </dtml-if> </dtml-in> </ul> DOH! -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of michael angelo ruberto Sent: Tuesday, March 06, 2001 6:18 PM To: michaelangelo@webmind.com; Jonothan Farr Cc: zope Subject: RE: [Zope] stupid question disregard the last message - i was being stupid. i thought this was working but it wasn't <dtml-if _['sequence-item'].objectValues(['File'])> back to the drawing board. ;) -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of michael angelo ruberto Sent: Tuesday, March 06, 2001 5:57 PM To: Jonothan Farr Cc: zope Subject: RE: [Zope] stupid question this is quite strange. i can get this to work if i remove the <dtml-var meta_type> tag. <ul> <dtml-in expr="PARENTS[0].objectValues(['File','DTML Document'])"> <dtml-if _['sequence-item'].objectValues(['File'])> <li><a href="<dtml-var absolute_url>"><dtml-var id></a> <dtml-var getContentType></li> <dtml-else> <li><a href="<dtml-var absolute_url>"><dtml-var id></a> <dtml-var meta_type></li> </dtml-if> </dtml-in> </ul> for some reason the meta_type method overrides the getContentType method if they are both used. ???? -----Original Message----- From: Jonothan Farr [mailto:jfarr@real.com] Sent: Tuesday, March 06, 2001 5:37 PM To: michaelangelo@webmind.com Cc: zope Subject: Re: [Zope] stupid question Python doesn't like the "sequence-item.getContentType()" part. Try: "_['sequence-item'].getContentType()" --jfarr ----- Original Message ----- From: "michael angelo ruberto" <michaelangelo@webmind.com> To: <zope@zope.org> Sent: Tuesday, March 06, 2001 2:26 PM Subject: [Zope] stupid question
hi,
why doesn't this work?
<dtml-if sequence-item.objectValues(['File'])> <td bgcolor="#EEEEEE"><dtml-let cType="sequence-item.getContentType()"><dtml-var cType></dtml-let></td> <dtml-else> <td bgcolor="#EEEEEE"><dtml-var meta_type></td> </dtml-if>
is there some other way to display the content type of a file?
thanks
-<mike>-
_______________________________________________ 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 )
_______________________________________________ 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 ) _______________________________________________ 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 )
participants (2)
-
Jonothan Farr -
michael angelo ruberto