[Zope] Namespace + syntax question

Tres Seaver tseaver@palladion.com
Tue, 15 Feb 2000 10:48:52 -0600


RC Compaan wrote:
> 
> I modified it like so:
>   <dtml-if "_.fmod(_['sequence-index'],10)==0">
>      </tr>
>      <tr><td><dtml-var sequence-item></td>
>   <dtml-else>
>      <td><dtml-var sequence-item></td>
>   </dtml-if>
> 
> Now i get:
>  Error Type: AttributeError
>  Error value: fmod

Ooops, fmod lives the math module::

  <p>fmod( 42, 13 ) is <dtml-var "_.math.fmod( 42, 13 )"></p>

works for me (note that it returns a floating point number.  The integer modulo
operator is what you seem to need::

  <p> 42 % 13 is <dtml-var "42 % 13"></p>

Tres.
-- 
=========================================================
Tres Seaver         tseaver@palladion.com    713-523-6582
Palladion Software  http://www.palladion.com