[Zope3-dev] ? vs $

Steve Alexander steve@cat-box.net
Fri, 14 Jun 2002 18:34:08 +0100


Jim Fulton wrote:
> 
> The rational for using ? was that ? isn't legal in Zope
> names.
> 
> I would prefer to treat this as a non-feature. In fact, 
> I would go so far as to take it out.
> 
> If someone really wants this, we ought to think harder about
> how to provide it.

I think it is a useful and concise syntax for a not uncommon requirement.

Consider the current incarnation of the JobBoard example. The method 
JobList.getApprovedIds returns a list of job ids.


<tr tal:repeat="jobid context/getApprovedIds">
     <td>
     <a href="jobid" tal:attributes="href jobid">
     <span tal:replace="context/?jobid/summary">A job summary</span></A>
     </td>
</tr>


The alternative is to use a python expression. I much prefer a simple 
syntax for interpolating paths.

     <span tal:replace="python:path('context/%s/summary' % jobid)">
       A job summary</span></A>

--
Steve Alexander