<dtml-in "PARENTS[0].objectValues(['job'])" sort=cust>
  <dtml-if "_['sequence-item'].title == AUTHENTICATED_USER.getUserName()">
    <TD rowspan="2" width="16%"><dtml-var
j_number> ---------------------------
and variations
still no joy.....
is the best way to mast the dtml syntax by learning python
I am afraid I feel lost reading the DTML  reference
can't when to use what syntax
feel like a moron can't even do a simple if statement
help appreciated


> > As a newbie i have tried a few variations on the following
> > but the <dtml-if> never returns true
> >
> >  <dtml-in "PARENTS[0].objectValues(['customer'])" sort=lname>
> >         <dtml-if "(_['sequence-item'].title == AUTHENTICATED_USER)">
> >           <tr><td>customer </td><td><dtml-var accno></td>
> >     .......and other values from "customers" folder with meta type
> > </dtml-if>
> > </dtml-in>
> This gets many, many people (including myself). Zope-defined Web request
> variables are usually objects. You are using AUTHENTICATED_USER as if it
> a string, which it is not, thus your dtml-if always fails.
> To get what you want, use (Zope Quick Reference v. 0.9):
> Something that adds to newbies' confusion on this is that if one writes,
> one gets the very username that one expects but yet the <dtml-if> still
> "I can see the freaking name is right!!!! Why are you failing!!???" is the
> expurgated version of what I said when I got bit by this one.
> The reason that <dtml-var AUTHENTICATED_USER> renders nicely to the same
> string that AUTHENTICATED_USER.getUserName() does is that
> is an object of type lib/python/AccesControl/User. This object has the
> getUserName() method but it also has a "__str__" method that Python allows
> to be defined for any class. This "__str__" method is the way that an
> should be represented whenever it is printed. In the case of the User
> lib/python/AccessControl/ defines the method __str__ as:
> def __str__(self): return self.getUserName()
> ------------------------------------------------------
> Andres Corrada-Emmanuel   Email: [EMAIL PROTECTED]
> ------------------------------------------------------
> _______________________________________________
> Zope maillist  -  [EMAIL PROTECTED]
> **   No cross posts or HTML encoding!  **
> (Related lists -
> )

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to