[ZPT] zpt compare repeat

Dieter Maurer dieter@handshake.de
Mon, 27 Jan 2003 22:22:38 +0100


jamie@f-resource.com wrote at 2003-1-27 07:06 -0500:
 > What I am trying todo is compare zopetime against a preinserted date
 > in a sql table in the format xxxx/xx/xx
 > 
 > So if the date is == to zope time all rows with the matching date are
 > displayed.
 > 
 > 
 > <tr tal:condition="python:here.ZopeTime().strftime('%m/%d/%Y')== 'db/date'">
This can not work!

  "...strftime('%m/%d/%y')" will give a string with two "'" occurences.
  "'db/date'" is a string literal with just a single occurence.
  They will never be equal...

Maybe, you mean:

  <tr tal:define:"dbdate	db/date"
      tal:condition:"python: ....strftime(...) == dbdate"
  >

but you did not explain well what you mean...


Dieter